-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
support loading css first #1032
Comments
We're seeing a lot of issues with this, where the I'm still trying to work out if our particular issue is because something is being cached when it shouldn't be, but the current behaviour is really confusing - at the very least if the CSS isn't available it should 404 or something and show a clear error somewhere instead of returning garbage. |
.svelte files never end up in the browser cache. do you mean js modules compiled from .svelte files? please file a separate issue with a reproduction for this. |
Yes. I've opened vitejs/vite#19632 because I think it's a general vite issue. But it would have helped a lot with debugging this if vite-plugin-svelte had given a clear error instead of silently returning garbage. |
Describe the problem
Currently css is cached and returned as a virtual module when
.svelte
files are imported as js module.But with vite
?direct
or?inline
query urls, it is possible that the first request is not for the js module but the css.Describe the proposed solution
In case the cache is empty when css is requested, compile.
Alternatives considered
keep current behavior, styles might not be needed before the js module
Importance
nice to have
The text was updated successfully, but these errors were encountered: