Bug with next-i18next and deployment on Vercel
See original GitHub issueVerify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
"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
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
Vercel
Describe the Bug
Context
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:
What we tried
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.
Setup Description
- catch all route in pages folder
- page set to static site generation
- default locale is set
- incremental static regeneration is on
Expected Behavior
working Translations
Link to reproduction
https://github.com/everdropde/ed-i18n-bug
To Reproduce
- Clone the Repo and deploy it to Vercel
- Click any link on page
Issue Analytics
- State:
- Created a year ago
- Reactions:14
- Comments:13 (5 by maintainers)
@swarnava Unrelated to fixing this, should there perhaps be a notice put on https://www.vercel-status.com/? I know that when we first were impacted by this that was the first stop for us to see if there was a Vercel issue.
I ask this because if anyone tries to redeploy an old version, that version breaks as well so it is impossible to rollback. If this is a production website/app, that ends up being an outage for that customer.
I am working with the team to prepare a fix for this. Appreciate your patience everyone!