-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
App router 404 without middleware or "ERR_TOO_MANY_REDIRECTS" with middleware. #1141
Comments
I am using the middleware suggested at the Next.js docs. I've found that when using next-translate-plugin If I get the next request after the first redirection this is what I get:
Since the I don't know why this happens, but if I remove i18n from Maybe it has something to do with the fact that Next.js internationalization docs don't mention putting i18n in the config file for the app router since i18n support has been dropped for the app router (they do mention it for the pages router). Should the i18n config section still be included when using app router? |
Can confirm that as mentioned in #1142 comments setting the config.i18n to undefined fixes the issue. Works well enough to keep developing on but I'm not shipping to prod like this. |
This is solved in 3.0.0-canary.1 version (both, next-translate & next-translate-plugin) |
What version of this package are you using?
What operating system, Node.js, and npm version?
Mac OS, Node 18.16.1
What happened?
When implementing the basic version as described in the documentation, loading the page /en/translations with my middleware on results in ERR_TOO_MANY_REDIRECTS and when I remove my middleware (which honestly is a no-go, we need it for production obviously) I get a 404.
What did you expect to happen?
Show me a basic translated page.
Are you willing to submit a pull request to fix this bug?
I have spent 2 days trying to debug it but I'm clueless as to what the problem could be.
More information / Code:
page.tsx (app/[lang]/(site)/translations/page.tsx)
next.config.js
Maybe relevant middleware code
i18n.js config
locales folder structure
Even more info:
tried this #1111 (comment) this worked on a specific nextjs version but broke with middleware, which means our team cannot implement this solution.
tried suggested NextJS version "next": "^13.4.12",
Thanks for reading and if you have any suggestions let me know!
The text was updated successfully, but these errors were encountered: