JavaScript heap out of memory during next build (Next 15.1)
pchab opened this issue · 12 comments
pchab commented
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/distracted-forest-vhlczj?workspaceId=ws_LGaEwH7iNTCahs4YK1orjP
To Reproduce
- Have a moderately complex page to build (generateStaticParams + parallel routes)
next build
- process will crash
JavaScript heap out of memory
(usually during the 'Collecting page data' step)
Current vs. Expected behavior
next build
process doesn't crash.
Provide environment information
Binaries:
Node: 22.12.0
npm: 10.9.0
Yarn: 1.22.19
pnpm: 8.10.2
Relevant Packages:
next: 15.1.1-canary.0 // Latest available version is detected (15.1.1-canary.0).
eslint-config-next: N/A
react: 19.0.0
react-dom: 19.0.0
typescript: 5.3.3
Next.js Config:
output: N/A
(Also tested with node 20)
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next build (local), Vercel (Deployed)
Additional context
The crash doesn't happen if I reduce the size of the array returned by generateStaticParams
or if I remove a couple parallel routes. This happens on all platform I tested: Vercel, locally and on codesandbox.io.
This used to work correctly with next@15.0.4
.
icyJoseph commented
Hi, could you move this to a Stackblitz instead of codesandbox? Just type next.new
into your browser address bar, and redo the example there.