NextJS page keep reloading again and again. #21839
-
What version of Next.js are you using? 10.0.3 What version of Node.js are you using? 12.0.0 What browser are you using? Chrome What operating system are you using? macOS, Windows How are you deploying your application? next start Describe the Bug It occurs sometimes to me that my page keeps reloading and again. I don't know why it occurs but it happens for only one page and the problem is that I am unable to reproduce this but I often get feedbacks from the users and acknowledged one or two times myself that it is reloading my page again and again. can you please guide that what can be the issue that It keeps reloading? when i close the tab and reopen the page it does not occur. Strange Expected Behavior It should not reload page and again To Reproduce I am unable to reproduce this by repeating any scenario. |
Beta Was this translation helpful? Give feedback.
Replies: 22 comments 6 replies
-
I too have a page reloaded every ~30 seconds or so when running in dev mode and not touching a single source file. What could be the problem? How to stop Next.js from reloading the page? |
Beta Was this translation helpful? Give feedback.
-
Yep, It was happening to me, keeps refreshing, and unable to test my site |
Beta Was this translation helpful? Give feedback.
-
@aslamcodes @meglio @touqeeraslam I just faced a similar problem with a teammate. And the reason was that I have added those configurations in the
I am on windows with a 12 gb ram which goes pretty quickly when chrome - node - vscode are all running so I was trying to save there. While it did not have any adverse effect for me, my teammate who has a MAC was seeing the pages being refreshed again and again. Removing those configs make things work again for him. So I can guess that having those specific parameters with those values can create this kind of side effect. Like if you have customs values try to remove them, and restart your dev; or if you don't have try to add with higher values especially for when testing try to not have a too many programs in memory. hopefully I was helpful. thanks |
Beta Was this translation helpful? Give feedback.
-
Hey NextJs team, could you add an explanatory comment to the console (both browser console and command line console) that explains why exactly a page got reloaded? It would make it much easier for people to investigate issues like this. |
Beta Was this translation helpful? Give feedback.
-
I'm facing the similar issue. Anyone looking into this from nextjs team? |
Beta Was this translation helpful? Give feedback.
-
Why the issue is closed ? |
Beta Was this translation helpful? Give feedback.
-
I am facing the same issue, but the problem occur only on the 404 page. |
Beta Was this translation helpful? Give feedback.
-
Some pages in my app keeps on reloading, anyone got a solution to it? |
Beta Was this translation helpful? Give feedback.
-
Same here. If page is a 404, it keeps infinitely reloading. |
Beta Was this translation helpful? Give feedback.
-
Same issue, if anyone finds the same please let us know |
Beta Was this translation helpful? Give feedback.
-
I have deployed my next.js application AWS instance if I try to access
query params on production the app keeps reloading but on Vercel it was
working fine
|
Beta Was this translation helpful? Give feedback.
-
To add a little more info, We are having the same issue in production, so as I stand now the problem seems to be some sort of caching, apparently the page builds and the buildId changes but the cached version of the page on the client side keeps looking for the old file and when it does not find it it reloads the page, we always have 404 for |
Beta Was this translation helpful? Give feedback.
-
for me the issue seems to be fixed after I stopped the dev server and started it again |
Beta Was this translation helpful? Give feedback.
-
I've noticed that deleting the .next folder and restarting the dev process seems to solve it momentarily, however, making changes to the code can often cause it to start up again. If I stop the server, the client requests the page over and over at very high speed. This appears to be entirely driven from the front-end somewhere. |
Beta Was this translation helpful? Give feedback.
-
This worked for me too |
Beta Was this translation helpful? Give feedback.
-
There were a few issues here that should be resolved on the latest version of Next.js, e.g. when using |
Beta Was this translation helpful? Give feedback.
-
In the
Edit: Next 14 seems to have fixed this for us |
Beta Was this translation helpful? Give feedback.
-
Yes, the page continues to load and does not open. Is there a solution? |
Beta Was this translation helpful? Give feedback.
-
@leerob Any updates on this. |
Beta Was this translation helpful? Give feedback.
-
I had this problem and commented out the following lines in my next.config file:
everything was gravy after that. (using 14.2.4) |
Beta Was this translation helpful? Give feedback.
-
i am facing the same issue with version |
Beta Was this translation helpful? Give feedback.
-
the same problem happens to me in |
Beta Was this translation helpful? Give feedback.
There were a few issues here that should be resolved on the latest version of Next.js, e.g. when using
error.js
files. Please update the the latest version and if you're seeing a bug, open an issue with a reproduction 🙏