-
-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: Multiple exports break hot reloading #11087
Labels
Comments
Took a break, did more research, and a bit of discussion I realized this was not a plumbing issue between react and hot-reload, that has been replaced with fast-refresh. It by design will not apply the changes if there are non-React related exports. pmmmwh/react-refresh-webpack-plugin#249. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When a component file contains more than one export, CRA cannot hot-reload it.
Did you try recovering your dependencies?
Yes, experienced it on our work repo. Reproduced it in another person's test reproduction repo who ran into it, and then moments ago created a brand new create-react-app app and reproduced the issue again.
Which terms did you search for in User Guide?
Environment
Steps to reproduce
npx create-react-app cra-reload-repro
export const x = 5
. Doesn't seem to matter what is exported.yarn start
Expected behavior
The module is sent via WebSocket to the browser and then the update is applied so the text changes on-screen.
Actual behavior
The module is sent via WebSocket (confirmed in network tab of inspector), but the update is not applied. The text does not change on-screen.
Reproducible demo
https://github.com/eccentric-j/cra-reload-repro
Notes
If I should report this to another package or github repo, please point the way!
The text was updated successfully, but these errors were encountered: