- I verified that the issue exists in the latest Next.js canary release
"next": "12.2.5", // Also tested on 12.2.6-canary.7 and 12.1.6
"next-i18next": "12.0.0", // Also tested on 10.5.0
"react": "18.2.0", // Also tested on 17.0.2
"react-dom": "18.2.0" // Also tested on 17.0.2
Vercel
We encountered a bug around next-i18next that resulted in serverless crashes for catch-all routes. We noticed this bug for the first time Monday around 14:00 CET and think it is potentially related with a change in the serverless runtime/filestructure as older deployments that used to work stoped working when redeploying.
Some other people also seemed to have encountered the same bug. See also here:
So we upgraded our versions of next and next-i18next (like some of the other people did). With the most recent next.js and next-i18next versions translations seem to work only in very specific cases.
We created a minimal replicable deployment (Repo) where we prebuild two pages via putting them in getStaticPaths
:
Both pages do not use translations when opening them directly.
However, when first navigating to the index.js and then clicking on of the links the two pages use proper translation.
Note: The translations will break upon refresh.
- catch all route in pages folder
- page set to static site generation
- default locale is set
- incremental static regeneration is on
working Translations
Example repo here: https://github.com/everdropde/ed-i18n-bug Example Vercel Deployment: https://ed-i18n-bug.vercel.app/de
- Clone the Repo and deploy it to Vercel
- Click any link on page