Skip to content
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

Bug with next-i18next and deployment on Vercel #1940

Closed
serGlazkov opened this issue Aug 31, 2022 · 6 comments
Closed

Bug with next-i18next and deployment on Vercel #1940

serGlazkov opened this issue Aug 31, 2022 · 6 comments
Labels

Comments

@serGlazkov
Copy link

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

How are you deploying your application?

Vercel

Bug Description

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

Links to Reproduce

Example repo here: https://github.com/everdropde/ed-i18n-bug
Example Vercel Deployment: https://ed-i18n-bug.vercel.app/de

Steps To Reproduce

  1. Clone the Repo and deploy it to Vercel
  2. Click any link on page
@adrai
Copy link
Member

adrai commented Aug 31, 2022

You may open/reference this issue in the Vercel / Next.js repo. -> vercel/next.js#40130
Sound like to be a Vercel issue.

@breiko83
Copy link

Hello - having the same issues here. Posted on Vercel discussion: vercel/next.js#40099

@FBosler
Copy link

FBosler commented Aug 31, 2022

Could this be the reason? vercel/nft#304

@swarnava
Copy link

Setting VERCEL_CLI_VERSION=vercel@28.1.4 should fix the issue while we working on a permanent fix for this.

@swarnava
Copy link

swarnava commented Aug 31, 2022

Hi, could you confirm if you have outputFileTracing disabled ? If you have it enabled and using latest version of Next.js then this should work with latest CLI version

styfle added a commit to vercel/nft that referenced this issue Sep 1, 2022
Reverts #304 (partially)

There are too many corner cases that rely on the old behavior such as #307 so unfortunately we have to revert.

- Fixes #307 
- Related to i18next/next-i18next#1940 
- Related to https://stackoverflow.com/questions/73554073/bug-with-next-i18next-and-deployment-on-vercel-recently
@stale
Copy link

stale bot commented Sep 9, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 9, 2022
@stale stale bot closed this as completed Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants