Next.js Discord

Discord Forum

"RangeError: Maximum call stack size exceeded" when trying to build and deploy via Vercel

Checkered Giant posted this in #help-forum
Open in Discord
Checkered GiantOP
I'm trying to deploy my Next.js website on Vercel, but I'm getting a "RangeError: Maximum call stack size exceeded" error.

I'm not sure where to begin to troubleshoot this. Have tried researching the error further but it doesn't seem like a well-documented issue.

Here's the rest of the error log:
at parse (/vercel/path0/node_modules/next/dist/compiled/micromatch/index.js:15:6313)
at picomatch.makeRe (/vercel/path0/node_modules/next/dist/compiled/micromatch/index.js:15:21670)
at picomatch (/vercel/path0/node_modules/next/dist/compiled/micromatch/index.js:15:19637)
at /vercel/path0/node_modules/next/dist/compiled/micromatch/index.js:15:19294
at (<anonymous>)
at picomatch (/vercel/path0/node_modules/next/dist/compiled/micromatch/index.js:15:19286)
at micromatch.isMatch (/vercel/path0/node_modules/next/dist/compiled/micromatch/index.js:15:1090)
at /vercel/path0/node_modules/next/dist/build/collect-build-traces.js:245:48
at shouldIgnore (/vercel/path0/node_modules/next/dist/build/collect-build-traces.js:75:9)
at /vercel/path0/node_modules/next/dist/build/collect-build-traces.js:86:23
Error: Command "npm run build" exited with 1

2 Replies

Try to use the latest version of Next.js
Checkered GiantOP
Thanks for your response Hong. Since posting this I no longer encounter the above error after doing the following:
1) Deleting node_modules from the project folder
2) Deleting package-lock.json
3) Reinstalling dependencies
4) Fixing conflicting peer dependencies that arose
5) Installing the latest version of nextjs (14.1+)