You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The previous issue (#1031) has been closed because of the wrong reproducible example. But it's fixed and the example repository reproduces the bug consistently now.
Describe the bug
The pages with translation failed to load (500) if they have rewritten to a destination. This problem only occurs against a direct hit to the rewritten URL. Client-side navigation works totally fine.
Translations should work with the rewrites. Rewrites are the best option to handle slug translation so far.
Screenshots
Here is the vercel error output;
[GET]/tr/hakkimizda03:03:30:65
Status:-1
Duration:498.90ms
Init Duration: 153.21ms
Memory Used:87MB
ID:7sr9j-1615161809932-f1baf335c79f
User Agent:Mozilla/5.0(X11;Ubuntu;Linuxx86_64; rv:86.0)Gecko/20100101Firefox/86.0tObject.readdirSync(fs.js:1021:3)atgetAllNamespaces(/var/task/node_modules/next-i18next/dist/commonjs/config/createConfig.js:113:21)atcreateConfig(/var/task/node_modules/next-i18next/dist/commonjs/config/createConfig.js:118:29)at_callee$(/var/task/node_modules/next-i18next/dist/commonjs/serverSideTranslations.js:105:53)attryCatch(/var/task/node_modules/regenerator-runtime/runtime.js:63:40)atGenerator.invoke[as_invoke](/var/task/node_modules/regenerator-runtime/runtime.js:293:22)atGenerator.next(/var/task/node_modules/regenerator-runtime/runtime.js:118:21)atasyncGeneratorStep(/var/task/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)at_next(/var/task/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)atprocessTicksAndRejections(internal/process/task_queues.js:93:5){errno: -2,syscall: 'scandir',path: '/var/task/public/locales/en'}2021-03-08T00:03:31.551Zf7878e2d-ad85-4f03-8e02-e8badde3314dERRORError: ENOENT: nosuchfileordirectory,scandir'/var/task/public/locales/en'atObject.readdirSync(fs.js:1021:3)atgetAllNamespaces(/var/task/node_modules/next-i18next/dist/commonjs/config/createConfig.js:113:21)atcreateConfig(/var/task/node_modules/next-i18next/dist/commonjs/config/createConfig.js:118:29)at_callee$(/var/task/node_modules/next-i18next/dist/commonjs/serverSideTranslations.js:105:53)attryCatch(/var/task/node_modules/regenerator-runtime/runtime.js:63:40)atGenerator.invoke[as_invoke](/var/task/node_modules/regenerator-runtime/runtime.js:293:22)atGenerator.next(/var/task/node_modules/regenerator-runtime/runtime.js:118:21)atasyncGeneratorStep(/var/task/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)at_next(/var/task/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)atprocessTicksAndRejections(internal/process/task_queues.js:93:5){errno: -2,syscall: 'scandir',path: '/var/task/public/locales/en'}2021-03-08T00:03:31.551Zf7878e2d-ad85-4f03-8e02-e8badde3314dERRORUnhandledPromiseRejection{"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: ENOENT: no such file or directory, scandir '/var/task/public/locales/en'","reason":{"errorType":"Error","errorMessage":"ENOENT: no such file or directory, scandir '/var/task/public/locales/en'","errno":-2,"syscall":"scandir","path":"/var/task/public/locales/en","stack":["Error: ENOENT: no such file or directory, scandir '/var/task/public/locales/en'"," at Object.readdirSync (fs.js:1021:3)"," at getAllNamespaces (/var/task/node_modules/next-i18next/dist/commonjs/config/createConfig.js:113:21)"," at createConfig (/var/task/node_modules/next-i18next/dist/commonjs/config/createConfig.js:118:29)"," at _callee$ (/var/task/node_modules/next-i18next/dist/commonjs/serverSideTranslations.js:105:53)"," at tryCatch (/var/task/node_modules/regenerator-runtime/runtime.js:63:40)"," at Generator.invoke [as _invoke] (/var/task/node_modules/regenerator-runtime/runtime.js:293:22)"," at Generator.next (/var/task/node_modules/regenerator-runtime/runtime.js:118:21)"," at asyncGeneratorStep (/var/task/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)"," at _next (/var/task/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)"," at processTicksAndRejections (internal/process/task_queues.js:93:5)"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: Error: ENOENT: no such file or directory, scandir '/var/task/public/locales/en'"," at process.<anonymous> (/var/runtime/index.js:35:15)"," at process.emit (events.js:327:22)"," at processPromiseRejections (internal/process/promises.js:245:33)"," at processTicksAndRejections (internal/process/task_queues.js:94:32)"]}Unknownapplicationerroroccurred
The previous issue (#1031) has been closed because of the wrong reproducible example. But it's fixed and the example repository reproduces the bug consistently now.
Describe the bug
The pages with translation failed to load (500) if they have rewritten to a destination. This problem only occurs against a direct hit to the rewritten URL. Client-side navigation works totally fine.
Occurs in next-i18next version
8.1.0
Steps to reproduce
I've created a reproducible repo here; https://github.com/thiras/next-i18next-rewrite-bug Just deploy it on Vercel and hit
/tr/hakkimizda
directly (Turkish equivalent of/about
)Expected behaviour
Translations should work with the rewrites. Rewrites are the best option to handle slug translation so far.
Screenshots
Here is the vercel error output;
OS (please complete the following information)
Additional context
The example repo has deployed at https://next-i18next-rewrite-bug.vercel.app
Original page; https://next-i18next-rewrite-bug.vercel.app/about
Broken page with a rewrite to the original page; https://next-i18next-rewrite-bug.vercel.app/tr/hakkimizda
The Error has also attached as a screenshot from Vercel below.
The text was updated successfully, but these errors were encountered: