#Deploying to vercel maximum stack size exceed

1 messages · Page 1 of 1 (latest)

ripe stag
#

Hi i get this kind error when i try to deploy to vercel:

RangeError: Maximum call stack size exceeded
at parse (/vercel/path0/frontend/node_modules/next/dist/compiled/micromatch/index.js:15:6313)
at picomatch.makeRe (/vercel/path0/frontend/node_modules/next/dist/compiled/micromatch/index.js:15:21670)
at picomatch (/vercel/path0/frontend/node_modules/next/dist/compiled/micromatch/index.js:15:19637)
at /vercel/path0/frontend/node_modules/next/dist/compiled/micromatch/index.js:15:19294
at Array.map (<anonymous>)
at picomatch (/vercel/path0/frontend/node_modules/next/dist/compiled/micromatch/index.js:15:19286)
at micromatch.isMatch (/vercel/path0/frontend/node_modules/next/dist/compiled/micromatch/index.js:15:1090)
at /vercel/path0/frontend/node_modules/next/dist/build/collect-build-traces.js:244:48
at shouldIgnore (/vercel/path0/frontend/node_modules/next/dist/build/collect-build-traces.js:75:9)
at /vercel/path0/frontend/node_modules/next/dist/build/collect-build-traces.js:86:23
Error: Command "npm run build" exited with 1

wicked brambleBOT
#

Hi @ripe stag. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Based on the information provided in the extracts, encountering a "RangeError: Maximum call stack size exceeded" error during deployment on Vercel can be related to several factors, including specific package versions or configurations in your Next.js project. Here are some actionable steps and insights derived from the extracts that might help resolve the issue:

  1. Check for sharp Version: A common thread in the extracts is issues related to the sharp package version. It was noted that downgrading sharp from 0.33.2 to 0.33.1 resolved the issue for some users. If your project uses sharp for image optimization, consider adjusting the version.

    npm install sharp@0.33.1
    
  2. Next.js Version Update: Some users reported that updating to a specific canary version of Next.js (v14.0.5-canary.60) resolved issues related to maximum call stack size exceeded. This version included a fix for uncontrolled recursion in the Next.js build logic. Check your package.json to see if updating Next.js could be relevant for you.

    npm install next@v14.0.5-canary.60
    
  3. Consider Removing sharp: If deploying to Vercel, it's noted that sharp is automatically installed for you, and manually adding it might not be necessary. Removing sharp from your dependencies could potentially solve the problem without affecting your deployment on Vercel.

    npm uninstall sharp
    
  4. Review Next.js Configuration: Although not directly mentioned in relation to the stack size error, ensuring your Next.js configuration does not include unnecessary or misconfigured options might help. This includes reviewing settings related to outputFileTracingExcludes if you're using the standalone output feature.

#
  1. Check for Other Dependencies: The issue might not be isolated to sharp or Next.js alone. Review other dependencies and plugins for known issues or updates that might address stack size errors.

  2. Consult Next.js and Vercel Documentation: For the latest advice and troubleshooting steps, consult the official Next.js and Vercel documentation. They might have updated guidelines or fixes for issues related to deployment and build processes.

Remember, these steps are derived from user experiences and specific fixes mentioned in the extracts. The effectiveness of these solutions might vary based on the unique configurations and dependencies of your Next.js project. If the problem persists, consider seeking support directly from Next.js or Vercel communities, providing detailed information about your setup and the error encountered.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: