Astro Info
Astro v6.3.5
Vite v7.3.3
Node v22.22.0
System Linux (x64)
Package Manager pnpm
Output static
Adapter none
Integrations @astrojs/mdx (v5.0.6)
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
With dynamic routes using getStaticPaths(), changes to my global CSS can leave the CSS state on those pages out of sync. The changes only appear after refresh, or I get an initial flash of the old CSS before the new CSS applies. I only started seeing this after upgrading to Astro 6.
This may not be caused by getStaticPaths() alone. My failing route also renders MDX/content with render(entry), so the MDX/content module graph may be part of the trigger.
My current suspicion is that this is related to the dev CSS invalidation path. Astro collects page CSS through the per-route virtual:astro:dev-css:* module, and it looks like the global CSS change is handled by Vite but does not invalidate that collected route CSS module for this content route. So the page keeps serving previously collected CSS until refresh.
What's the expected result?
I would expect the CSS to correctly update via HMR like with regular routes.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-ovtyzqli?file=src%2Fstyles%2Fglobal.css
Participation
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
With dynamic routes using
getStaticPaths(), changes to my global CSS can leave the CSS state on those pages out of sync. The changes only appear after refresh, or I get an initial flash of the old CSS before the new CSS applies. I only started seeing this after upgrading to Astro 6.This may not be caused by
getStaticPaths()alone. My failing route also renders MDX/content withrender(entry), so the MDX/content module graph may be part of the trigger.My current suspicion is that this is related to the dev CSS invalidation path. Astro collects page CSS through the per-route
virtual:astro:dev-css:*module, and it looks like the global CSS change is handled by Vite but does not invalidate that collected route CSS module for this content route. So the page keeps serving previously collected CSS until refresh.What's the expected result?
I would expect the CSS to correctly update via HMR like with regular routes.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-ovtyzqli?file=src%2Fstyles%2Fglobal.css
Participation