Skip to content

JavaScript heap out of memory during next build (Next 15.1) #73793

@pchab

Description

@pchab

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/distracted-forest-vhlczj?workspaceId=ws_LGaEwH7iNTCahs4YK1orjP

To Reproduce

  1. Have a moderately complex page to build (generateStaticParams + parallel routes)
  2. next build
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue was opened via the bug report template.locked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions