Skip to content
This repository was archived by the owner on Jul 24, 2025. It is now read-only.

Vite 4 with SSR: HMR not working #46

@jvanmaaren

Description

@jvanmaaren

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

  • yarn create vite-extra (ssr+react, typescript + SWC)
  • yarn install
  • yarn dev
  • change some text in App.tsx
  • The browser console will say "[vite] hot updated: /src/App.tsx"
  • But the text will not be updated

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions