-
-
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 directory [lang] paths return 404 from NextJS v13.4.13 #1142
Comments
There were a couple changes around |
next.config.js setting i18n to undefined worked for me, idk if this has any drawbacks
|
I can confirm this removes the issue, it also helps with #1141 (more info there), but, as you've said, I don't know what the drawbacks could be, if any. I guess, since i18n support has been dropped for the App router, that config section doesn´t make sense when using said router (no mention to it in the App route docs for internationalization). |
Nice find, this seems like a good workaround if only |
The problem is Next.js normalizes |
I actually found a bug on the NextJS side that may be the cause of this: vercel/next.js#53724 |
Setting i18n to undefined solved my problem but now I see that the locale in the request.nextUrl is removed by nextJS, any work arounds for this? |
Same here. Setting i18n to undefined fixes the issue but I would love a more permanent and less hacky solution |
The |
Hi everyone. But now i'm getting errors during production build while nextjs is generating static pages:
I tried to bring back i18n to next config (removed line I'm not using pages folder so would like to continue using |
ah... |
Hi, It was hard to find this fix because I wasn't aware that the error started with version 13.4.13. (I upgraded from 13.4.12 to 14.0.0) Should we update the README with this fix or wait for a better one? Thanks! |
I'm using pages router and I have a redirect issue on the newer next.js version. I use this as a temporary solution:
If it also works for you, it's atleast better than setting i18n to undefined I guess? |
Can you tried in 3.0.0-canary.1 version? (both, next-translate & next-translate-plugin). Thanks |
One thing that wasn't noted, or maybe it's just me, @abuu-u's solution causes fast refresh to break, I am forced to disable translations while developing if I want fast refresh to work |
What version of this package are you using?
v2.5.3
What operating system, Node.js, and npm version?
MacOS, v18.7.0, 8.15.0
What happened?
Navigating to app directory pages with the
[lang]
path parameter returns 404 when NextJS is upgraded to 13.4.13 or later.I have created a simple reproduction of the issue in this repo. I simply used the NextJS official example for next-translate. When I first started it up it was working, but then once I upgraded NextJS and restarted the server, it started getting 404. I tried different versions of NextJS until I found that v13.4.12 works but v13.4.13 and later do not.
What did you expect to happen?
Page loads successfully.
Are you willing to submit a pull request to fix this bug?
I am motivated to get this fixed quickly, so I would be willing to help but I am not familiar with the internals of
next-translate
ornext
. With some guidance I would be happy to do the heavy lifting.There are quite a lot of changes from 13.4.12 to 13.4.13, so it's not immediately clear why this broke.
The text was updated successfully, but these errors were encountered: