This is a repo of a bug with the React Compiler, Vite, and the Vite plugin for React which facilitates Fast Refresh.
GitHub issue facebook/react#29115
- Clone this repo
git clone git@github.com:daniel-nagy/react-compiler-bug.git
- Install dependencies
npm install
- Start the dev server
npm run start
-
Edit the markdown file and observe that Fast Refresh is broken.
-
Comment out the React Compiler plugin in the Vite config and observe Fast Refresh works when the markdown changes.
This is likely because the React Compiler cache is global and because it treats imports as constants.