Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I've created a npm package that in development it works OK but when I run npm run build it retrieves the next error.
[vite-plugin-svelte] The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received '\x00__vite-browser-external?commonjs-proxy'
> The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received '\x00__vite-browser-external?commonjs-proxy'
Reproduction
This is the repo where this is happening.
I think it would be difficult to reproduce since you need to deploy the smart contract to run the project. With the SvelteKit version 251 this bug doesn't occur. As soon as you upgrade SvelteKit, the error happens.
Logs
[vite-plugin-svelte] The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received '\x00__vite-browser-external?commonjs-proxy'
> The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received '\x00__vite-browser-external?commonjs-proxy'
at new NodeError (node:internal/errors:371:5)
at createRequire (node:internal/modules/cjs/loader:1210:13)
at resolveViaPackageJsonSvelte (file:///Users/silvestrevivo/werk/2021/solana/solana-svelte-counter/app/node_modules/@sveltejs/vite-plugin-svelte/dist/index.js:1427:26)
at Object.resolveId (file:///Users/silvestrevivo/werk/2021/solana/solana-svelte-counter/app/node_modules/@sveltejs/vite-plugin-svelte/dist/index.js:1585:24)
at /Users/silvestrevivo/werk/2021/solana/solana-svelte-counter/app/node_modules/rollup/dist/shared/rollup.js:22795:37System Info
.Severity
annoyance
Reacted by Scott Tolinski, François Romain, Pieterjan and Yohei Noda
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
ashwinvasudevan commentedon Feb 28, 2022
try, catch has been removed around
resolveViaPackageJsonSveltefn. Adding try catch seems to solve the error. Downgrade to@sveltejs/[email protected]to solve the issue for nowsilvestrevivo commentedon Feb 28, 2022
@ashwinvasudevan thanks for the answer. I had to downgrade to
@sveltejs/[email protected]because sveltekit over251is overwriting to@sveltejs/[email protected]. But you are right, it seems an issue from that version what is causing the error.I get this problem with this package I am working on right now https://www.npmjs.com/package/@svelte-on-solana/wallet-adapter-ui that is the Official Wallet adapter for Solana Dapps. This is blocking me right now to make support to Svelte devs who want to develop Web3 based on Solana.
I hope this can be solved soon. Thanks!!!!
build: corrige une regression de vite-plugin-svelte
nikkwong commentedon Mar 2, 2022
This just broke the deployment of our app and I can't reason as to why as we're not upgrading the major or minor versions of sveltekit, svelte, or vite. What's going on?
I've tried downgrading to this version but i'm still getting the issue as it seems to be referencing the next-38 package. Is there a trick to getting it to reference the next.37 from package.json?
bluwy commentedon Mar 2, 2022
#286 is released in 1.0.0-next.38 which fixes this. Please upgrade to that version to resolve this issue.
nikkwong commentedon Mar 2, 2022
Like so? I am still getting the same issue:

)
bluwy commentedon Mar 2, 2022
If the workaround proposed in this issue didn't work for you, then it probably means you're hitting a slightly different issue then. I'd suggest providing repros and logs, or create a new issue with it so we can debug further.
nikkwong commentedon Mar 2, 2022
Thanks! It certainly seems to be the same issue, since the logging output is the same as the originally referenced one:
xpluscal commentedon Mar 2, 2022
@nikkwong FYI: I am receiving the exact same issue, but I don't have vite-plugin-svelte installed. Maybe an issue with kit?
nikkwong commentedon Mar 2, 2022
I was trying to install vite-plugin-svelte to override the version that the package itself uses; but to no avail. We can no longer build our app and can't find a workaround. Can this issue be reopened?
xpluscal commentedon Mar 2, 2022
Actually reverting: It is caused by vite-plugin-svelte apparently. the plugin was installed as dep of kit
bluwy commentedon Mar 2, 2022
Ugh I'm sorry. Turns out the fix is not released yet 😢
xpluscal commentedon Mar 2, 2022
thx @bluwy. Any known workarounds?
I'm curious how that happens even if no minor / major version bumps of svelte/kit or /vite-plugin-svelte happened?
Any versions that would not encounter this issue?
As @nikkwong mentioned it is breaking build processes (for us as well)
bluwy commentedon Mar 2, 2022
Might be an upgrade to Vite that causes the issue. But usually it's hard to know where this was caused on this part of the code. I'll check with @dominikg to make a new release soon.
xpluscal commentedon Mar 2, 2022
super thank you @bluwy 🙏
silvestrevivo commentedon Mar 2, 2022
@dominikg @bluwy thank you so much for solving this!!!
Nisthar commentedon May 16, 2022
I am getting the same error still
Nisthar commentedon May 16, 2022
ok created a new issue here #340