-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Rebuild HMR results in endless render cycle (?) (React) #1317
Comments
Same issue here. I'm building a Typescript React App and the parcel make my app fall in an infinite reload loop ! @nihiluis we both have in common |
@fathyb could this be related to |
@DeMoorJasper not sure, it doesn't do much that has an effect on runtime or HMR. @Christopher2K @nihiluis Does it still does it when you remove the plugin? If not could you provide a reproduction? If you can't share your code but can share your config (if any) it could help to find any other similarities. |
Same here, I will provide a reproduction repository. Thanks |
|
@fathyb I used to use |
FYI: I am using vim so I added the following settings
however, still happening. |
Hi, I could reproduce the issue, though it appears as different form. To reproduce
Then we will find a lot of ScreenshotsInvestigationIn this example, In my real (toy) project, editing component files managed by https://github.com/acro5piano/nail-carte Thanks! |
I confirm the behavior of repo created by @acro5piano. It fails only when editing the In my project it fails when I edit a |
@jpergler Thank you for the confirmation.
Yeah, in my project (not reproduce repo) it fails when editing |
Can confirm, its not related to .ts and also happens when saving .js files. (1.7.1 here) |
Hey guys, in my case, for a project I ended up working with the issue is with some sort of circular dependencies (just imported/resolved by parcel, not executed). I'll try to illustrate it: app/ import { Header, Footer } from "./components"
// ... │├─ components/ export { default as Header } from './Header.js'
export { default as Footer } from './Footer.js'
export { default as List } from './List.js'
export { default as ListItem } from './ListItem.js' │├─ List.js import { ListItem } from './'
// ... |
Did you fixed it by resolving the circular dependencies? |
Same here. |
I just read @gesposito 's case and I found my code also has circular dependencies. |
In my case, when referencing a function from b.js in a.js,at the meanwhile referencing a function from a.js in b.js,as follow: // filename: a.js
import { fnB } from 'b.js' // filename: b.js
import { fnA } from 'a.js' and then I use |
As a work around: This appears to prevent the infinite / circular dependency issue that causes the browser to hang. In the entry js/ts of the application.
|
Parcel is nearly unusable for me due to this as it constantly hangs. I'm using Parcel 1.11.0 with no plugins. |
@slikts Any chance you can share a reproduction? Modifying package.json will update all assets, making debugging hard. |
@DeMoorJasper I can't figure out where parcel/packages/core/parcel-bundler/src/builtins/hmr-runtime.js Lines 152 to 160 in 58a0348
|
Can confirm that this also occurs for me when I have circular imports, same as @MuYunyun. 100% reproducible, and it always stops infinite render looping as soon as I remove the circular imports. |
@mindgrub-egottlieb how do I find circular imports in my deps graph? I'm stuck on this as @slikts, can't use parcel v2 😩 |
@bard I had to use |
🐛 bug report
I use parcel and then change a file, parcel rebuilds and then my React reloads/rerenders (something like that) forever and my pc goes out of RAM and dies for 5 min. when I use console.log("s") it prints this infinitely, thats why i think it reloads. maybe it is related to some redirect logic of the route.. (ubt the conditions are not given)
🎛 Configuration (.babelrc, package.json, cli command)
parcel ./index.html
i have no bubble
🤔 Expected Behavior
hot reloda no crash
😯 Current Behavior
hot reload endless cycle
💁 Possible Solution
dont know. turn off hot reload.
🔦 Context
crash my firefox by using lots of memory
💻 Code Sample
dont have
🌍 Your Environment
The text was updated successfully, but these errors were encountered: