#getStaticPaths on vercel - accessing fallback page with next-i18next results in error

15 messages · Page 1 of 1 (latest)

dull pumice
#

Cheers guys,

I am hosting my next app on vercel. Until today this was without a problem at all. Out of nowhere, an issue appeared.

For all of the pages that are not prerendered (hence the fallback in getStaticPaths is true) we receive an error from the serverless function.

Error:
2022-08-29T19:57:50.021Z 300099ef-fe49-442f-a317-2c921881fe70 ERROR Error: ENOENT: no such file or directory, scandir '/var/task/frontend/public/locales/de' at Object.readdirSync (fs.js:1048:3) at getLocaleNamespaces (/var/task/frontend/node_modules/next-i18next/dist/commonjs/config/createConfig.js:175:23) at /var/task/frontend/node_modules/next-i18next/dist/commonjs/config/createConfig.js:181:20 at Array.map (<anonymous>) at getNamespaces (/var/task/frontend/node_modules/next-i18next/dist/commonjs/config/createConfig.js:180:44) at createConfig (/var/task/frontend/node_modules/next-i18next/dist/commonjs/config/createConfig.js:221:29) at _callee$ (/var/task/frontend/node_modules/next-i18next/dist/commonjs/serverSideTranslations.js:199:53) at tryCatch (/var/task/frontend/node_modules/regenerator-runtime/runtime.js:63:40) at Generator.invoke [as _invoke] (/var/task/frontend/node_modules/regenerator-runtime/runtime.js:293:22) at Generator.next (/var/task/frontend/node_modules/regenerator-runtime/runtime.js:118:21) { errno: -2, syscall: 'scandir', path: '/var/task/frontend/public/locales/de', page: '<Pagename here>'}

Quite interesting: When we redeploy very old builds the same error appears. Hence we figure this must be an issue on the side of vercel?

Do you experience a similar issue?

arctic tulip
#

Same here

dull pumice
#

@arctic tulip Did you find any workarounds so far? I sent a message to the support yesterday but did not get any reply

quasi tide
#

Same problem

slate pond
#

same here

arctic tulip
#

@dull pumice We change to use i18next-http-backend rather than file-based locale files. But I think this is a workaround. Hope the support team can start to investigate this issue.

slate pond
#

same problem, did something change with the file structure?

arctic tulip
#

@dull pumice What's your next.js version? Do you turn off the outputFileTracing ? We used to turned off the outputFileTracing, but it seems like everything is fine when we turn on this config.

slate pond
#

@arctic tulip we are on next 12.1.6

#

we have outputFileTracing turned off

dull pumice
#

@arctic tulip We are running 12.2.5 and have outputFileTracing on

dull pumice
#

It seems as though an update of next.js to 12.2.5 and outputFileTracing on has fixed the issue for us. FYI @slate pond @slate pond @quasi tide

slate pond
#

@dull pumice nice! well try this

quasi tide
#

@dull pumice could you share your next.config.js ?

quasi tide