Skip to content

HMR / React Fast Refresh not working in microfrontend setup when using react-swc #992

@gursimranjitsingh-web

Description

@gursimranjitsingh-web

Related plugins

Describe the bug

In a microfrontend architecture, Hot Module Replacement (HMR) and React Fast Refresh stop working when the microfrontends use react-swc (or any SWC-based React transform such as @vitejs/plugin-react-swc, @swc/loader, or SWC inside a custom build setup). The same architecture works correctly with Babel-based React Refresh.

Reproduction

https://github.com/vitejs/vite-plugin-react/

Steps to reproduce

No response

System Info

System:
    OS: macOS 26.1
    CPU: (8) arm64 Apple M3
    Memory: 68.77 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.11.0 - /usr/local/bin/node
    npm: 11.6.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 142.0.7444.176
    Safari: 26.1
  npmPackages:
    @vitejs/plugin-react-swc: ^4.2.1 => 4.2.2 
    vite: ^7.2.2 => 7.2.2

Used Package Manager

npm

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