You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This snippet works with vite when I remove svelte-kit plugin. However, it throws following error on the browser console when I use this plugin.
Uncaught TypeError: Failed to resolve module specifier "@master/css". Relative references must start with either "/", "./", or "../".
This happens on both development as well as production build. As a workaround I am copying the @master/css/index.js to my static folder and importing it as import "/master.css.js"
This is because SvelteKit controls serving the HTML, which doesn't call transformIndexHtml, a hook that applies Vite's transformation such as your example. But in the bigger picture, perhaps you're looking for sveltejs/kit#3127? Closing as this isn't an issue in vite-plugin-svelte.
Describe the bug
I would like preload one of my external dependency. For this I have placed a
script
tag withtype="module"
as followsThis snippet works with
vite
when I remove svelte-kit plugin. However, it throws following error on the browser console when I use this plugin.This happens on both development as well as production build. As a workaround I am copying the
@master/css/index.js
to mystatic
folder and importing it asimport "/master.css.js"
Reproduction
Here's the reproduction.
working.html
andworking.vite.config.js
has the config that works whensveltekit()
plugin is removed.You will need to append
src/working.html
to the url since the entry point has changed.Logs
System Info
System: OS: Linux 5.0 undefined CPU: (4) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 16.14.2 - /usr/local/bin/node Yarn: 1.22.10 - /bin/yarn npm: 7.17.0 - /bin/npm npmPackages: vite: ^3.0.1 => 3.0.2
Severity
annoyance
The text was updated successfully, but these errors were encountered: