Skip to content

fix: raise the Node heap limit for the SDK build - #1473

Merged
alexb-openrouter merged 1 commit into
mainfrom
devin/1794603234-build-heap-limit
Nov 13, 2026
Merged

alexb-openrouter merged 1 commit into
mainfrom
devin/1794603234-build-heap-limit

Conversation

@alexb-openrouter

@alexb-openrouter alexb-openrouter commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The last three Publish runs (1.5.101, 1.5.102, and the merge of #1372) failed in npm run build with FATAL ERROR: ... JavaScript heap out of memory in tsc, so nothing has reached npm since 1.5.100.

Cause: the Publish workflow runs npm install without a lockfile, so it resolves the newest zod 4.x (4.6.7). pnpm-lock.yaml, used by PR validation and local builds, pins 4.2.1. Type-checking the generated models against zod 4.6.7 peaks above the default Node heap limit on the runner (about 4 GB). With the lockfile, the build peaks at about 2.4 GB.

Change, in both .speakeasy/gen.yaml additionalScripts (source of truth) and package.json:

- build:   tsc && node scripts/unbarrel-imports.js
+ build:   node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js
  (same for compile)

typecheck is unchanged.

Verified on a fresh clone of this branch with npm install --ignore-scripts && npm run build. It resolves zod 4.6.7 the same way Publish does, and the build completes in 37s with a peak RSS of 4.5 GB.

This PR doesn't touch .speakeasy/gen.lock, so merging it doesn't trigger Publish. After merging, run Publish manually (workflow_dispatch) to release the current main version.

The Publish workflow installs with npm and no lockfile, so it resolves
the newest zod 4.x. Type-checking the generated models against it peaks
above Node's default heap limit, and the last three publish runs failed
with an out-of-memory error in tsc. Run tsc with an 8 GB heap in the
build and compile scripts.
@alexb-openrouter
alexb-openrouter merged commit 1094dd9 into main Nov 13, 2026
1 check passed
@alexb-openrouter
alexb-openrouter deleted the devin/1794603234-build-heap-limit branch November 13, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant