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
{{ message }}
Repository navigation
SCSS file changes trigger full page reload instead of HMR #14869
Astro v5.14.3
Vite v6.3.6
Node v22.14.0
System macOS (arm64)
Package Manager npm
Output static
Adapter @astrojs/node (v9.4.4)
If this issue only occurs in one browser, which browser is a problem?
Chrome
Describe the Bug
When modifying .scss files during development, Astro triggers a full page reload instead of hot module replacement (HMR). This disrupts the development workflow as it loses current state and scroll position.
I'm sure it comes from the place I linked as I tried it locally (at least with the provided minimal reproduction). Let's figure this out first and then we can look into other places where this could occur if the problem is still there
Activity
id-87 commentedon Nov 24, 2025
@aralroca Please assign me this issue.
aralroca commentedon Nov 24, 2025
Of course, thanks @id-87
aralroca commentedon Nov 24, 2025
@id-87 I cannot assign you, probably some of the Astro maintainers can do it @matthewp @FredKSchott @natemoo-re
danivicario commentedon Nov 24, 2025
This is an important issue in the project I am working on, as this bogs you down a lot while implementing the figmas or experimenting.
Thank you mr @aralroca for raising this, hoping the astro team kindly can solve this issue @id-87
🙏
florian-lefebvre commentedon Nov 24, 2025
Interesting, the scss is correctly invalidated but then we actually force a full reload here: https://github.com/withastro/astro/blob/main/packages/astro/src/vite-plugin-hmr-reload/index.ts#L30. Probably need to fix the logic above
aralroca commentedon Nov 25, 2025
It seems to come from somewhere else. I've added a similar plugin to Astro:
https://stackblitz.com/edit/github-f9txtpa5?file=astro.config.mjs
After saving the
.scssfile,hasSsrOnlyModulesisfalseandmodulesis[].florian-lefebvre commentedon Nov 25, 2025
I'm sure it comes from the place I linked as I tried it locally (at least with the provided minimal reproduction). Let's figure this out first and then we can look into other places where this could occur if the problem is still there
ignacioroan commentedon Nov 27, 2025
Have the same issue in my current project. Will be cool to have it solved, the page reload is a bit annoying :(
aralroca commentedon Nov 28, 2025
Adding
Fixes the issue. No idea about this
invalidationState, it's not typed in Astro but exists in the module. Any idea @florian-lefebvre ? Thanksflorian-lefebvre commentedon Nov 28, 2025
Not at all, I don't know this area well. Feel free to send a PR!
fix: avoid full-reload in scss modules (#14924)
chore: merge main into next (#16434)