aws-lambdanext.jsserverlessvercelnext-i18next

Bug with next-i18next and deployment on vercel (recently)


Update 2:

This probably has to do with the this PR where assets have been removed as dependency.

Update 1:

Managed to get a reverse shell into the serverless function and it really would appear that there is no public folder anymore:

enter image description here

enter image description here

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

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

Solution

  • https://github.com/vercel/next.js/issues/40130

    Setting env variable VERCEL_CLI_VERSION=vercel@28.1.4 fix the issue

    Also if you set outputFileTracing: true in next.config.js it works with latest CLI version