-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WASM+SvelteKit: TypeError: Failed to construct 'URL': Invalid URL
on client after successful build
#2480
Comments
You should really file this in the Vite repo if you'd like it to be solved because this is quite unlikely to be an issue in SvelteKit itself. For more details, see https://github.com/sveltejs/kit/blob/master/README.md#bug-reporting |
@benmccann Accoriding to that issue, Vite transforms
Current
So, now really weird crutch-fix is to fork rollup-plugin-assemblyscript and add
Could you recommend a better fix? Maybe there is a way to change kit's |
It's probably because we support Node 12, which doesn't support es2020 very well: https://node.green/#ES2020 However, we were about ready to drop Node 12 support, so I can bump the ES version at the same time |
@stanf0rd thanks for digging into this. Can you upgrade to |
I can confirm that with the next target for @sveltejs/kit, import.meta.url is still blank |
Describe the bug
Hi! I am trying to setup SvelteKit with WASM (compiled using rollup-plugin-assemblyscript). My wasm-module loads on client using onMount hook:
After successful build I receive such error on client:
Inside generated add-*.js file:
Looks like missing import.meta.url, but I'm not sure.
Reproduction
You can reproduce described error here:
https://github.com/stanf0rd/rasseki-game/tree/wasm-setup
Just
and look into browser console on localhost:3000
Logs
System Info
Severity
blocking all usage of SvelteKit
Additional Information
Looks similar with that case, but there was an error at build step with SSR feature.
#1896: Error "new URL(url, import.meta.url) is not supported in SSR." with ssr: false & adapter-static
The text was updated successfully, but these errors were encountered: