Error during Collecting build traces on vercel build

Building my Next.js app locally works flawlessly, but when I try to build it on Vercel I get this error when it is trying to collect build traces:

RangeError: Maximum call stack size exceeded
    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 Array.map (<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

Does someone have an idea why this happens on Vercel but not locally?

It was a problem with my Next.js version, see: RangeError: Maximum call stack size exceeded · vercel · Discussion #5491 · GitHub.

2 Likes

Thanks for coming back to share this solution!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.