Hi everyone,
I'm encountering an issue while deploying my Next.js project on Vercel. The build process fails with the following error:
Creating an optimized production build ...uncaughtException RangeError: Invalid array length at Array.push (<anonymous>)Error: Command "npm run build" exited with 1I’ve tried the following troubleshooting steps but haven’t found a solution:
- Cleared
.nextandnode_modules, then reinstalled dependencies - Checked for any infinite loops or excessive recursion in my code
- Ran
npm run buildlocally, which works fine without errors
I'm using:
- Next.js version: 15.2.2
- Vercel deployment method: (GitHub integration, CLI, etc.)
Has anyone faced a similar issue or knows what might be causing this? Any guidance would be greatly appreciated!
Thanks in advance!