My site name is development-ionicprotocol, accessible at development.ionic.money.
We have been deploying fine for weeks, but now our development build just started showing an error on the live site:
This function has crashed
An unhandled error in the function code triggered the following message:
Error - Cannot find module 'next/dist/compiled/@next/react-dev-overlay/dist/middleware' Require stack: - /var/task/node_modules/next/dist/server/web/sandbox/context.js - /var/task/node_modules/next/dist/server/lib/render-server.js - /var/task/node_modules/next/dist/server/lib/router-server.js - /var/task/node_modules/next/dist/server/lib/start-server.js - /var/task/packages/ui/.netlify/dist/run/next.cjs
Stack trace
Error: Cannot find module 'next/dist/compiled/@next/react-dev-overlay/dist/middleware'
Require stack:
- /var/task/node_modules/next/dist/server/web/sandbox/context.js
- /var/task/node_modules/next/dist/server/lib/render-server.js
- /var/task/node_modules/next/dist/server/lib/router-server.js
- /var/task/node_modules/next/dist/server/lib/start-server.js
- /var/task/packages/ui/.netlify/dist/run/next.cjs
at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
at /var/task/node_modules/next/dist/server/require-hook.js:55:36
at Module._load (node:internal/modules/cjs/loader:985:27)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at mod.require (/var/task/node_modules/next/dist/server/require-hook.js:65:28)
at require (node:internal/modules/helpers:176:18)
at Object.<anonymous> (/var/task/node_modules/next/dist/server/web/sandbox/context.js:45:24)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
Connection details
Netlify internal ID: 01HV1HM9895YT5AW99PPQE9H2Q
We did not update any dependencies nor change any code that should have caused this error. Can anyone help us to debug where this is coming from?
Hi, @rhlsthrm. The site in question is not using the Netlify build system. This site is being deployed manually. This means the issue occurred in your local builds which we cannot see to debug.
By the way, it looks like this site build with Node.js 16 based on this:
Even version 18 is maintenance support only. I’d strong recommend getting your site upgraded to use at least Node.js 20 before doing any other troubleshooting.
Again, we do not support using the netlify/plugin-nextjs version 4 with Next.js 14. If you are using Next.js 14, we only provide support for the version 5 package. If you are not using version 5 of netlify/plugin-nextjs for Next.js 14, we will not be able to provide any troubleshooting support until this is resolved.
We are using the Netlify build system (see CI pipeline).
We confirmed that simply setting the netlify/plugin-nextjs to v4 versus omitting it from the package.json is the difference between working and not working.
Is there any suggestion for what can be going wrong? Our UI and pipeline code is all open source.