vitejs / vite-plugin-react-swc

Speed up your Vite dev server with SWC
MIT License
781 stars 50 forks source link

Vite 4 with SSR: HMR not working #46

Closed jvanmaaren closed 1 year ago

jvanmaaren commented 1 year ago

Describe the bug

Description: For the default setup created by "yarn create vite-extra" (with SSR) HMR does not work

Expectation: When I change a text in App.tsx, I should immediately see the change in my browser

Reproduction

https://github.com/jvanmaaren/vite4-react-ssr

Steps to reproduce

You can also see the problem in this sandbox: https://codesandbox.io/p/github/jorgvm/vite4-react-ssr/draft/boring-cherry

All files were created by the "yarn create vite-extra" command

System Info

System:
    OS: macOS 13.2
    CPU: (8) x64 Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
    Memory: 10.52 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node
    Yarn: 1.22.15 - ~/.nvm/versions/node/v16.15.0/bin/yarn
    npm: 8.5.5 - ~/.nvm/versions/node/v16.15.0/bin/npm
  Browsers:
    Chrome: 109.0.5414.87
    Chrome Canary: 111.0.5560.0
    Edge: 109.0.1518.61
    Firefox: 109.0
    Safari: 16.3
  npmPackages:
    @vitejs/plugin-react-swc: ^3.0.0 => 3.0.1
    vite: ^4.0.0 => 4.0.4

Used Package Manager

yarn

Logs

No response

Validations

jvanmaaren commented 1 year ago

thanks!

ArnaudBarre commented 1 year ago

This will be available in next stable version, release Thursday with Vite 4.1 if everything goes well