-
Notifications
You must be signed in to change notification settings - Fork 27.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
NextJS Hot Reload #30791
Comments
so far it seems when middleware file is removed the issue doesn't occur (will have to keep debugging more to see any refresh happening again |
I was about to submit the same issue. There are multiple unexpected behaviours:
|
I don't know if it is related, but I have the exact same issue when I include a "_document.tsx" file in my pages directory. Any code modification in my components triggers a full reload of the page. When "_document.tsx" is removed, hot reloads work as intended. Even the default _document example from the vercel website triggers the same full reload behaviour. Next.js 12.0.0 & 12.0.2 |
I also have the same issue, probably is because of middleware. |
I can confirm that removing I am using Next.js v12.0.3 and basic auth middleware example. |
Same |
Fixes #30791 The issue is that with Middleware we are introducing client compilation on a new layer. When a middleware changes (or is dropped after some time), Webpack reorganizes non-user modules as they are duplicated across different layer. This is currently triggering a full reload. This also brings tests for HMR: - Refresh on a Middleware change - HMR works after a middleware compilation change. Co-authored-by: Tobias Koppers <[email protected]>
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Fixes vercel#30791 The issue is that with Middleware we are introducing client compilation on a new layer. When a middleware changes (or is dropped after some time), Webpack reorganizes non-user modules as they are duplicated across different layer. This is currently triggering a full reload. This also brings tests for HMR: - Refresh on a Middleware change - HMR works after a middleware compilation change. Co-authored-by: Tobias Koppers <[email protected]>
What version of Next.js are you using?
12.0.2
What version of Node.js are you using?
14.17.1
What browser are you using?
Chrome
What operating system are you using?
macOS
How are you deploying your application?
Local
Describe the Bug
NextJS keeps refreshing when code is updated, the log below shows what happens
I've read about the warning in other issues, but didn't have it prior to upgrading to next 12
while
_devMiddlewareManifest
is new
couldn't reproduce due to the fact the project is actually big and was working fine prior to upgrading
any update is causing a refresh
Expected Behavior
The page shouldn't be refreshing
To Reproduce
Upgraded to next 12.0.2 and used a middleware in a subfolder (nothing else)
The text was updated successfully, but these errors were encountered: