-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Infinite Redirect Loop on 404 Page in Production #8306
Comments
Hey @lorenzrabs, I'm able to reproduce your issue consistently by building (via I'm attaching a video of the current behavior. I haven't deployed this application, it's currently running on my local windows machine however I'm able to reproduce your issue with both mongodb and the postgres adapter. I've attached a video of the issue. Looking at console logs indicates it's an RSC problem. chrome_2024-09-19_18-51-07.mp4 |
I have this issue in development as well - only difference is that the error is displayed in the console and the screen is blank. |
Just pushed an update to the website template in #8454 Along with the previous bumping of next canary, payload updates and this I haven't been able to reproduce this issue. Let me know if you do |
The issue still exist. payload: 3.0.0-beta.110, I assumed that generateStaticParams() in page template doesn't render routes for created pages in cms, during build process, so instead i used getStaticPaths() returning paths with option "fallback: 'blocking'". And routes to my pages are generated, but.. in this case i got infinite redirect loop on Page 404 on production.
|
Actually it should still generate static paths at build: https://nextjs.org/docs/app/api-reference/functions/generate-static-params and you'll see these routes in the output during build. getStaticPaths doesnt work in the app router anymore, it's been replaced by the above: https://nextjs.org/docs/app/building-your-application/upgrading/app-router-migration#dynamic-paths-getstaticpaths The pages will be statically generated at build time if you add the following in the page.tsx file while maintaining the previous features:
During build you'll see this static indicator
As for the redirect loop I still haven't been able to reproduce it. But I have found a couple of other bugs that I'll be deploying in a bit. I will close this issue for now, but if anyone has any further info or reproduction steps we can re-open it or make a new issue and tag me in it, thanks everyone! |
This issue has been automatically locked. |
Link to reproduction
No response
Environment Info
Describe the Bug
When visiting a non-existent page (404) in production, the page flickers continuously, suggesting an infinite redirect loop. The browser console shows the following error:
This issue only appears in production mode. In development mode, the error is displayed in the console, but the 404 page loads correctly without flickering.
Reproduction Steps
Adapters and Plugins
No response
The text was updated successfully, but these errors were encountered: