-
While developing locally I'm encountering two situations that are undesirable and make me want to disable HMR altogether, but I wonder if I'm just doing something wrong, so looking for advice here. If I make 3 independent edits and click save in my editor and come back to my app it reloads three times (and fires off three network requests since I'm fetching data immediately in an effect. Is that sort of time-travel reload intentional? Apologies if this is just how HMR is supposed to work and I'm asking here on the NextJS forum ;) But still, maybe you've got some advice? More challenging is that when I create an error (quite often a ReferenceError to an undefined variable while refactoring or fat fingers) I'll come over to my browser and it goes into a death refresh loop, just reloading over and over and over (and firing network requests ala above). I usually can't keep up with the console logs and then just kill the Chrome tab in the Task Manager because my laptop is starting to get overworked. In that case I lose the error as well, so it's a pretty rough developer experience. Thoughts? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
Same issue here, sometimes I need to close the tab and open another one due too many HMR / requests being fired at once. |
Beta Was this translation helpful? Give feedback.
-
Old suggestionCan you please try React Refresh on `next@canary`? You can enable it in `next.config.js`: ```js // next.config.js module.exports = { experimental: { reactRefresh: true, }, } ```Next.js 9.4 has a completely new HMR system that is more reliable and correct! Please upgrade. 😄 |
Beta Was this translation helpful? Give feedback.
Old suggestion
Can you please try React Refresh on `next@canary`? You can enable it in `next.config.js`: ```js // next.config.js module.exports = { experimental: { reactRefresh: true, }, } ```Next.js 9.4 has a completely new HMR system that is more reliable and correct! Please upgrade. 😄