Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading sharp from 0.33.1 to 0.33.2 breaks Next.js build on Vercel #3955

Closed
samuelcole opened this issue Jan 16, 2024 · 2 comments
Closed

Comments

@samuelcole
Copy link

After upgrading the sharp package, I was unable to deploy with the following error when "collecting build traces":

volunteer:build:    Collecting build traces ...
volunteer:build: RangeError: Maximum call stack size exceeded
volunteer:build:     at RegExp.exec (<anonymous>)
volunteer:build:     at create (/vercel/path0/node_modules/next/dist/compiled/micromatch/index.js:15:18889)
volunteer:build:     at create (/vercel/path0/node_modules/next/dist/compiled/micromatch/index.js:15:18918)
volunteer:build:     at parse.fastpaths (/vercel/path0/node_modules/next/dist/compiled/micromatch/index.js:15:18997)
volunteer:build:     at picomatch.makeRe (/vercel/path0/node_modules/next/dist/compiled/micromatch/index.js:15:21635)
volunteer:build:     at picomatch (/vercel/path0/node_modules/next/dist/compiled/micromatch/index.js:15:19637)
volunteer:build:     at /vercel/path0/node_modules/next/dist/compiled/micromatch/index.js:15:19294
volunteer:build:     at Array.map (<anonymous>)
volunteer:build:     at picomatch (/vercel/path0/node_modules/next/dist/compiled/micromatch/index.js:15:19286)
volunteer:build:     at micromatch.isMatch (/vercel/path0/node_modules/next/dist/compiled/micromatch/index.js:15:1090)
volunteer:build: ERROR: command finished with error: command (/vercel/path0/apps/volunteer) /vercel/.yarn/bin/yarn run build exited (1)
volunteer#build: command (/vercel/path0/apps/volunteer) /vercel/.yarn/bin/yarn run build exited (1)

My understanding is that Next.js is walking through node_modules to understand which files need to be included in the lambda runtime. Is there something in sharp, or its dependencies, that could have a really deep or recursive folder structure?

@lovell
Copy link
Owner

lovell commented Jan 16, 2024

Please see #3944

@lovell lovell closed this as completed Jan 16, 2024
@samuelcole
Copy link
Author

Thanks! To be even more clear for future googlers, the issue is Vercel's: https://github.com/orgs/vercel/discussions/5449

Sorry for the noise!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants