Skip to content

build: give the type-check a 4 GB heap (fixes the Amplify deploy) - #339

Merged
edeNFed merged 1 commit into
mainfrom
fix/build-heap
Sep 6, 2026
Merged

build: give the type-check a 4 GB heap (fixes the Amplify deploy)#339
edeNFed merged 1 commit into
mainfrom
fix/build-heap

Conversation

@edeNFed

@edeNFed edeNFed commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Amplify's main deploy for 39c629e fails in the build phase after a successful compile:

✓ Compiled successfully in 31.6s
Running TypeScript ...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

The build image runs Node 22 with a ~2 GB default old-space limit, and the project's TypeScript check now needs about 2.25 GB. Reproduced locally: node --max-old-space-size=2048 tsc --noEmit dies the same way; at 4096 it passes with a 2.25 GB peak RSS.

This sets NODE_OPTIONS=--max-old-space-size=4096 on the build script so the fix is versioned. Amplify's standard build instance has enough memory for it. yarn build verified green locally with the change.

https://claude.ai/code/session_01TxkiFYtGhZVcNWyxHHEdH6

Amplify's build image runs Node 22 with a ~2 GB default old-space
limit. next build compiles, then the TypeScript step runs out of
memory at that limit: the project's type-check now peaks at about
2.25 GB. Setting the heap in the build script keeps the fix in the
repo rather than in the hosting console.

Claude-Session: https://claude.ai/code/session_01TxkiFYtGhZVcNWyxHHEdH6
@edeNFed
edeNFed merged commit 5f2ea39 into main Sep 6, 2026
2 of 3 checks passed
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