-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Missing styles since Astro 5 #12616
Comments
In V5, this error is also thrown if
UpdateYou should flush the folder named |
@bozdevs can you submit a separate issue with its own repro please |
@lilnasy Even though this is a regression with Astro 5, it would be a good idea to submit this as an issue to ecsstatic too. It's hard to say if this is an issue with that plugin + Vite 6, or if it's Astro-specific, as the plugin hasn't been updated for Vite 6 yet. |
This does only seem to be an issue in dev too: when I run a build, it works correctly. |
The issue is astro specific. The styles added onto astro components are missing. They still load with framework components. Although, the use with framework components changed in a more subtle way: the stylesheet is not added immediately in the initial html, rather it is added by vite client js dynamically. This affects vite 6 too but it does not block upgrading, the entirely missing styles in astro components do. That might mean vite no longer adds the css to the module graph (not immediately, at least), and that's why astro fails to retrieve them in astro/packages/astro/src/vite-plugin-astro-server/pipeline.ts Lines 122 to 136 in 24edead
astro/packages/astro/src/vite-plugin-astro-server/css.ts Lines 14 to 24 in 24edead
...and css for astro components is added only on initial page load, unlike for framework components, relying on full page refresh to update them, which seems to be another regression. |
I have not took a deeper look, but my hunch is that |
It uses side effect imports, not css modules. Would you expect a difference between astro and framework components with the breaking change you linked? |
Yes as framework components are rendered client side which Vite takes over and dynamically adds CSS by itself. The breaking change I linked affects all kinds of CSS, not only CSS modules. |
If that is the relevant breaking change, how would the plugin migrate? Would it be by hooking the load of the css file with |
I've sent a fix downstream. The idea is for virtual module CSS to support the |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Stylesheet generated by vite plugins is no longer added to the page.
What's the expected result?
Same result that astro 4 generates.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-ojxby9
Participation
The text was updated successfully, but these errors were encountered: