Skip to content

yarn start crashes with "JavaScript heap out of memory" on trunk #110379

@aaronyan

Description

@aaronyan

Context and steps to reproduce

After pulling the latest trunk and running the standard local-dev bootstrap, yarn start crashes during webpack compilation with FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory. The dev server boots, the first request to http://calypso.localhost:3000/ is served, but the asset compilation pass OOMs and the process exits.

Steps to reproduce

  1. git checkout trunk && git pull (latest as of 1809a08b23b).
  2. yarn install.
  3. nvm use (Node v24.15.0, the version specified in .nvmrc).
  4. yarn start.
  5. Open http://calypso.localhost:3000/ in the browser to trigger compilation.

Expected

yarn start finishes the initial compile and prints Ready!, after which the app loads.

Actual

Node crashes mid-compile:

<--- Last few GCs --->
[63101:0x9ed40c000]    96198 ms: Scavenge (interleaved) 4003.4 (4071.2) -> 3982.1 (4141.2) MB, pooled: 0 MB, 5.38 / 0.00 ms  (average mu = 0.351, current mu = 0.341) allocation failure;
[63101:0x9ed40c000]    96836 ms: Mark-Compact (reduce) 3989.7 (4142.0) -> 3936.2 (4012.7) MB, pooled: 0 MB, 65.54 / 0.00 ms ... (average mu = 0.355
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

The default V8 old-space cap (~4 GB) is being hit by the webpack build. The Wanted node version notice (^v24.15.0) was already corrected before the failing run — this is reproducing on the supported Node version, not on the older Node 22 that nvm initially picked up.

Environment

  • Branch: trunk at 1809a08b23b
  • Node: v24.15.0 (per .nvmrc)
  • Yarn: 4.0.2 (also reproduced after yarn set version 4.14.1)
  • OS: macOS (Darwin 25.4.0), Apple Silicon (darwin-arm64)

Possible workaround

Bumping the Node old-space limit before yarn start, e.g. NODE_OPTIONS=--max-old-space-size=8192 yarn start, lets the build complete on machines with enough RAM. If this is the expected workaround, it would be helpful to either (a) bake it into the start script, or (b) document it in AGENTS.md / the contributing docs so new clones don't trip on it.

Site owner impact

Fewer than 20% of the total website/platform users (developer-only — affects local dev environments, not production users).

Severity

Major — local development is the primary contributor workflow and yarn start failing out of the box blocks everyone hitting it until they discover the heap-size workaround.

Platform

Self-hosted (developer environment only)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugWhen a feature is broken and / or not performing as intendedNeeds triageTicket needs to be triaged

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions