Skip to content
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

HMR not working in CSS Modules dependency #16074

Open
7 tasks done
privatenumber opened this issue Mar 2, 2024 · 2 comments · May be fixed by #16018
Open
7 tasks done

HMR not working in CSS Modules dependency #16074

privatenumber opened this issue Mar 2, 2024 · 2 comments · May be fixed by #16018

Comments

@privatenumber
Copy link
Contributor

Describe the bug

When updating a composed CSS Module file, HMR doesn't get triggered. Since the file change isn't detected, refreshing the page doesn't work either—the server must be restarted.

This is fixed by #16018, but wanted to file it for tracking purposes since this seems like a pretty major issue that wasn't reported.

Reproduction

https://stackblitz.com/edit/vitejs-vite-npddeu?file=src%2Fstyle.module.css,src%2Futils.module.css

Steps to reproduce

  1. In style.module.css, uncomment L5 to confirm HMR works in an entry CSS Module file
  2. In utils.module.css, uncomment L4 to see that HMR does not get triggered
  3. Refresh the page to see that doesn't work either. Server must be restarted

System Info

N/A

Used Package Manager

npm

Logs

No response

Validations

Copy link

stackblitz bot commented Mar 2, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@privatenumber
Copy link
Contributor Author

This is fixed via https://github.com/privatenumber/vite-css-modules but will keep this open until fixed in Vite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant