next-i18next: `Internal Server Error` with next.js@13.5.4
🐛 Bug Report
500 Internal Server Error with next.js version 13.5.4 in standalone build.
To Reproduce
- clone repo https://github.com/peakercope/material-ui-nextjs-pages-router-ts-example
- run
pnpm i
- run
pnpm build
- run
node .next/standalone/server.js
- open in browser
http://localhost:3000/
Actual behavior
Error page opened
Terminal error:
Error: Cannot find module 'core-js/modules/es.array.map.js'
Require stack:
- /material-ui-nextjs-pages-router-ts-example/.next/standalone/node_modules/.pnpm/next-i18next@14.0.3_cziuidd23tbj2wqeyxn2xirvka/node_modules/next-i18next/dist/commonjs/config/createConfig.js
- /material-ui-nextjs-pages-router-ts-example/.next/standalone/node_modules/.pnpm/next-i18next@14.0.3_cziuidd23tbj2wqeyxn2xirvka/node_modules/next-i18next/dist/commonjs/appWithTranslation.js
- /material-ui-nextjs-pages-router-ts-example/.next/standalone/node_modules/.pnpm/next-i18next@14.0.3_cziuidd23tbj2wqeyxn2xirvka/node_modules/next-i18next/dist/commonjs/index.js
- /material-ui-nextjs-pages-router-ts-example/.next/standalone/.next/server/pages/_app.js
- /material-ui-nextjs-pages-router-ts-example/.next/standalone/node_modules/.pnpm/next@13.5.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/require.js
- /material-ui-nextjs-pages-router-ts-example/.next/standalone/node_modules/.pnpm/next@13.5.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/next-server.js
- /material-ui-nextjs-pages-router-ts-example/.next/standalone/node_modules/.pnpm/next@13.5.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/next.js
- /material-ui-nextjs-pages-router-ts-example/.next/standalone/server.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
at /material-ui-nextjs-pages-router-ts-example/.next/standalone/node_modules/.pnpm/next@13.5.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/require-hook.js:54:36
at Module._load (node:internal/modules/cjs/loader:922:27)
at Module.require (node:internal/modules/cjs/loader:1143:19)
at mod.require (/material-ui-nextjs-pages-router-ts-example/.next/standalone/node_modules/.pnpm/next@13.5.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/require-hook.js:64:28)
at require (node:internal/modules/cjs/helpers:119:18)
at Object.<anonymous> (/material-ui-nextjs-pages-router-ts-example/.next/standalone/node_modules/.pnpm/next-i18next@14.0.3_cziuidd23tbj2wqeyxn2xirvka/node_modules/next-i18next/dist/commonjs/config/createConfig.js:35:1)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/material-ui-nextjs-pages-router-ts-example/.next/standalone/node_modules/.pnpm/next-i18next@14.0.3_cziuidd23tbj2wqeyxn2xirvka/node_modules/next-i18next/dist/commonjs/config/createConfig.js',
'/material-ui-nextjs-pages-router-ts-example/.next/standalone/node_modules/.pnpm/next-i18next@14.0.3_cziuidd23tbj2wqeyxn2xirvka/node_modules/next-i18next/dist/commonjs/appWithTranslation.js',
'/material-ui-nextjs-pages-router-ts-example/.next/standalone/node_modules/.pnpm/next-i18next@14.0.3_cziuidd23tbj2wqeyxn2xirvka/node_modules/next-i18next/dist/commonjs/index.js',
'/material-ui-nextjs-pages-router-ts-example/.next/standalone/.next/server/pages/_app.js',
'/material-ui-nextjs-pages-router-ts-example/.next/standalone/node_modules/.pnpm/next@13.5.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/require.js',
'/material-ui-nextjs-pages-router-ts-example/.next/standalone/node_modules/.pnpm/next@13.5.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/next-server.js',
'/material-ui-nextjs-pages-router-ts-example/.next/standalone/node_modules/.pnpm/next@13.5.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/next.js',
'/material-ui-nextjs-pages-router-ts-example/.next/standalone/server.js'
]
}
Expected behavior
Home page without an error should be opened
Your Environment
- runtime version: node v18.18.0, pnpm v7.25.0 browser Google Chrome Version 117.0.5938.92
- i18next version:
"i18next": "23.5.1",
"next": "13.5.4",
"next-i18next": "14.0.3",
"react-i18next": "13.2.2"
- os: Mac
About this issue
- Original URL
- State: closed
- Created 9 months ago
- Reactions: 28
- Comments: 25 (6 by maintainers)
Commits related to this issue
- build: trying to downgrade next to fix vercel deploy issue related: https://github.com/i18next/next-i18next/issues/2214 https://github.com/vercel/next.js/issues/56357 — committed to pietrobondioli/mywebsite-nextjs by pietrobondioli 9 months ago
- build: trying to downgrade next to fix vercel deploy issue related: https://github.com/i18next/next-i18next/issues/2214 https://github.com/vercel/next.js/issues/56357 — committed to pietrobondioli/mywebsite-nextjs by pietrobondioli 9 months ago
- fix: pin Next.js version to 13.5.3 to prevent https://github.com/i18next/next-i18next/issues/2214 — committed to Eldemarkki/recipeamigo by Eldemarkki 9 months ago
FWIW: Errors went away for me after updating to 13.5.5.
same here I had to rollback to 13.5.3 seems a problem on next side but good to report here as took me a good day of work trying to figure out which package was failing. The problem happens when using getServerSideProps and serverSideTranslations the pages with getStaticProps and serverSideTranslations works fine.
+1, I have the same issue as I upgraded Next to 13.5.4 (Node 18, yarn).
I get the same error when I access the deployed app on Vercel.
Edit: it does not happen on all pages using i18n, but on some. I may find out the difference between them and keep you posted.
It looks like this might have been fixed in the this PR which is available in
13.5.5-canary.8
.(For those “removing the ^”, know that you’re simply pinning next to 13.5.3—downgrading from 13.5.4 has already been highlighted as a workaround for this issue.)
Same issue after upgrading Next to 13.5.4 and deploying to Vercel (issue is not present in local environment). Downgrading to 13.5.3 fixes the deployment.
Removing the ‘^’ of the next-version worked for me. before:
"next": "^13.5.3", "next-i18next": "^14.0.3", "i18next": "^23.5.1", "react-i18next": "^13.2.2"
after:"next": "13.5.3", "next-i18next": "^14.0.3", "i18next": "^23.5.1", "react-i18next": "^13.2.2"
Downgrading to next@13.5.3 works. Here is the log:
yes sure, I made a clean installation several times with pruned pnpm store. The issue is reproduced every time for production run (“node .next/standalone/server.js”) on both my local machine (AppleM1 / macos 13.6) and in docker container (node:18.17-alpine3.18).
pnpm dev
works well