Closed willemliufdmg closed 2 years ago
Just updated to Next 13.0 and i am still facing the same issue. Sentry is getting destroyed by this error.
Updated to 12.3.2 and still have this issue.
@shadowgroundz @dimitrisdi @maria404 I don't think the Next team will act on a closed issue, so might be better to open a new one.
Hi, if you are still seeing this error it appears to be unrelated to the initial issue described here as that is now resolved, please open a fresh issue with reproduction.
@shadowgroundz @dimitrisdi @maria404 I don't think the Next team will act on a closed issue, so might be better to open a new one.
Must I open a new ticket for same issue while that still exist on newer version?
@shadowgroundz What they mean is, if you're still getting the error, then it must have a different root cause than the issue in this ticket. For that, you should open a new ticket so the team can examine your issue.
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
Deployed to Vercel
What browser are you using? (if relevant)
Not relevant
How are you deploying your application? (if relevant)
Vercel
Describe the Bug
It seems that since Next.js v12.2 the internal router does an extra fetch for the current page.js. This didn't happen in the older versions of Nextjs (see screenshots below). If the current URL is a dynamic route and is rewritten (our case in Middleware) the extra page.js fetch will result in a 404. This causes an attempt to reload the current page which then runs into the
handleHardNavigation
errorInvariant: attempted to hard navigate to the same URL
.Current production Next.js v12.1:
Develop Next.js v12.2:
Expected Behavior
Should just load the page without errors.
Link to reproduction
https://router-3zllgxvkw-fdmediagroep.vercel.app/nieuws
To Reproduce
Minimal reproduction repo: https://github.com/FDMediagroep/router-bug
Next Middleware rewrite rules:
Navigating to
/nieuws
will result in the error as described in the bug description for Next.js since v12.2. But not on the older version v12.1.