Skip to content

HMR for CSS imported with ?url is not working #772

@markdalgleish

Description

@markdalgleish

Related plugins

Describe the bug

When importing CSS with ?url and then rendering to a link element (or returning from a links function export from a route module in React Router Framework Mode, but I'm reproducing this at a lower level) styles are not updated when editing the CSS file.

Reproduction

https://github.com/markdalgleish/vitejs-plugin-rsc-css-url-hmr-issue-reproduction

Steps to reproduce

  1. pnpm install
  2. pnpm dev
  3. Open http://localhost:5173 in the browser
  4. Edit src/test-server.css and src/test-client.css

Changes should be reflected in the browser immediately, but instead require a full page reload.

System Info

System:
    OS: macOS 15.5
    CPU: (12) arm64 Apple M4 Pro
    Memory: 649.91 MB / 48.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.5.0 - ~/.nvm/versions/node/v24.5.0/bin/node
    npm: 11.5.1 - ~/.nvm/versions/node/v24.5.0/bin/npm
    pnpm: 10.8.0 - ~/Library/pnpm/pnpm
    bun: 1.0.1 - ~/.bun/bin/bun
  Browsers:
    Chrome: 139.0.7258.139
    Edge: 139.0.3405.111
    Firefox Nightly: 122.0a1
    Safari: 18.5
  npmPackages:
    @vitejs/plugin-react: latest => 5.0.1 
    @vitejs/plugin-rsc: latest => 0.4.23 
    vite: ^7.1.2 => 7.1.3

Used Package Manager

pnpm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions