I get a 404 with localeSubpaths only on production build. In develop everthing works fine.
v6.0.2
I get no error so i have no clue
http://localhost:3000/en -> statusCode 200 and not 404
I will try to submit a reproducible repo.
Let me know when you put together a reproducible repo, and I'll have a look.
Got the same problem. Reproducible Repo: https://github.com/michelalbers/next-i18next-404
@michelalbers Couple issues with that repo regarding your TS setup. Regardless, I was able to run the app via yarn build && yarn start, and can not see any 404 errors. Can you provide specific instructions as to how I can reproduce the error?
Try yarn dev :)
Running with yarn dev does not produce any 404s for me either.
I have the feeling it doesn鈥檛 work when u didn鈥檛 run next build initially. Will confirm when I鈥檓 back at the office.
I did a fresh clone of the repo, and then just did yarn && yarn dev. I had to install TS deps because they were not present. I did not run yarn build.
Figured it out ... I had next.js 9.4.4 in my cache which does not support rewrites. Next.js 9.5 is required which came out 11 days ago. Could we add that to the readme?
@mweibel How did you fix it exactly? How can i clean the cache?
How did you fix it exactly? How can i clean the cache?
In my case it was as simple as yarn add next@^9.5.0
Well, it's in the package.json, and you would have been receiving warnings from npm or yarn. Not sure it's worth adding to docs.
I still get a 404
Well, it's in the
package.json, and you would have been receiving warnings from npm or yarn. Not sure it's worth adding to docs.
Yes you get a peer dependecy warning ... but in every bigger project you might have quite a few from them. Anyway - my issue is resolved. Thank you very much @isaachinman
@gpessa and @Uniiq you will need to provide a reproducible repository if you would like help debugging.
@isaachinman i sry for the late response. The first problem was i forgot to remove await nextI18next.initPromise; from custom next server file (i upgraded from [email protected] ).The second problem is i use cacheable-response to cache the SSR response and somehow next-i18next interfere with my caching function and redirect me to 404 error page (caching is only enabled on production).
In short there is a bug on my side. :)
@isaachinman i sry for the late response. The first problem was i forgot to remove
await nextI18next.initPromise;from custom next server file (i upgraded from[email protected]).The second problem is i usecacheable-responseto cache the SSR response and somehownext-i18nextinterfere with my caching function and redirect me to 404 error page (caching is only enabled on production).
@Uniiq sorry! what is the solution for this bug? This only happens in production mode. What should I do? Some help please?
Most helpful comment
@gpessa and @Uniiq you will need to provide a reproducible repository if you would like help debugging.