Error on HMR reload
See original GitHub issueI am trying to use fast refresh with WPS. With some components it works fine however with others, I get this error.
Plugin version 0.4.1
WPS: 1.0.1
main.js:558 Uncaught (in promise) Error: Aborted because ./src/client/views/home/HomeView.js is not accepted
Update propagation: ./src/client/views/home/HomeView.js -> ./src/client/views/routes.js -> ./src/client/app.js -> ./src/client/main.js -> 0
at hotApplyInternal (main.js:558)
at hotApply (main.js:412)
at replace (hmr.js?797c:60)
hotApplyInternal @ main.js:558
hotApply @ main.js:412
replace @ hmr.js?797c:60
async function (async)
replace @ hmr.js?797c:47
eval @ client.js?a662:70
Any pointers where could the issue lie?
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
HMR + Fast Refresh - Snowpack
Hot Module Replacement (HMR) is the ability to push file updates to the browser without triggering a full page refresh. Imagine changing some...
Read more >New Setup with Webpack 5 and Dev-Server and HMR thrown ...
I updated my setup and with the new modules my HOT reloading no longer works. I get the following error message:
Read more >How to fix the NextJS HMR(hot reload ... - DEV Community
When working on NextJS applications inside WSL2, there seems to be an issue with HMR (Hot Reload) not detecting changes to your code...
Read more >[resolved] [user-error] React-fast-refresh && HMR
If I remember correctly, HMR forces Reload to reload the page when it is not successful in applying the update with HMR. With...
Read more >HMR and Hot Reloading with the webpack-dev-server
Optional HMR which means that the page will reload automatically when after compilation completes. Note, some developers do not like this, as you'll...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
(Sorry for missing this)
Yes.
How
webpack-dev-server
and source error works is that they compile files on the fly and store them in memory - soindex.tsx
is not actually being served to the browser, it’s just that the error originates from code within that file.Yes. Let’s say your component tree is like this:
Component A -> index.ts (ReactDOM.render)
If Component A is changed and we can update it, fine we won’t propagate the update (only Component A updates). But if the update from Component A defies what we require for a safe update, we would have to go to its parent. However, it’s parent is also unsafe to update in place - so eventually we bubbled to “root” which means to the actual entry point of the JS - so the only way we can guarantee consistency is to bail out (in browsers this equals a full refresh).
That is also not something we print - it is what
webpack-dev-server
prints when it hits a bail out case.Refering to the case I’ve described above - the best way to avoid unnecessary bail outs when you edit code paths that is very close to root (i.e. ReactDOM.render) is to not have any JSX at all in the file you do ReactDOM.render.
This is because we only construct boundaries with exports, and the file containing ReactDOM.render would most likely not have any exports, thus will never have a boundary.
In my case, it was caused by additional export next to component export: