I have encountered the following error while deploying my Next.js application on Vercel:
RangeError: Maximum call stack size exceeded
at RegExp.exec (<anonymous>)
at create (/vercel/path0/node_modules/next/dist/compiled/micromatch/index.js:15:18889)
at create (/vercel/path0/node_modules/next/dist/compiled/micromatch/index.js:15:18918)
at parse.fastpaths (/vercel/path0/node_modules/next/dist/compiled/micromatch/index.js:15:18997)
at picomatch.makeRe (/vercel/path0/node_modules/next/dist/compiled/micromatch/index.js:15:21635)
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)
Error: Command "npm run build" exited with 1
I couldn't use debugging options, like NODE_DEBUG=regex npm run build
, to gain new insights.
I appreciate any suggestions and thank you beforehand.
using sharp version 0.33.1 resolved the issue for me.
Removing sharp too