rr-rsc-framework-server-route-css-modules-hmr-issue

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

Steps to reproduce

  1. Run pnpm install
  2. Run pnpm dev
  3. Go to http://localhost:5173/server-first
  4. Type something in the input field
  5. Edit the styles in app/routes/server-first/styles.module.css
  6. The input field state is maintained, but the styles disappear
  7. 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.