This is a reproduction of an HMR issue where editing a CSS Modules file imported by a server-first route results in styles disappearing.
Note: To ensure we're using the latest HMR logic from @vitejs/plugin-rsc, this repro is using the preview release from this PR: vitejs/vite-plugin-react#788
- Run
pnpm install - Run
pnpm dev - Go to http://localhost:5173/server-first
- Type something in the input field
- Edit the styles in
app/routes/server-first/styles.module.css - The input field state is maintained, but the styles disappear
- Refresh the page to see the new styles applied correctly
For comparison, this repro also contains a client-first route that is not affected by this issue.