Repository navigation
Conversation
pnpm typecheck and pnpm build ran tsc under Node's default old-space cap, about 2 GB on a machine that reports less memory: the run died with exit 134, "heap out of memory", before a single type error was printed. The packaged builds already raise it for the same work; scripts/typecheck.mjs does the same for the dev commands, in one process that runs both passes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
pnpm typecheckandpnpm buildruntsc -bandtsc -p server/tsconfig.jsonunder whatever heap Node hands them. On a machine whose default old-space cap is around 2 GB the server project outgrows it, and the run dies with exit 134 and "heap out of memory" before it prints a single type error, so the command that CONTRIBUTING and the development guide tell people to run cannot finish there. The packaging paths already raise the cap for the same work, withNODE_OPTIONS=--max-old-space-size=4096in.github/workflows/release.ymland the same default inscripts/release-mac-local.sh, and the dev commands were the one place left without it.scripts/typecheck.mjsruns both passes in one process withNODE_OPTIONS=--max-old-space-size=4096, keeps a larger value when the caller already set one, and stops at the first failing pass with that pass's exit code.package.jsonsendstypecheckandbuildthrough it, sovite buildstill runs on its own once the types are checked. It is a small wrapper rather thanNODE_OPTIONS=... tscinside the script becauseVAR=value cmdis not a thing on Windows, and it spawnsprocess.execPathwith the resolvedtypescript/bin/tscinstead of a shell, which is the rule AGENTS.md andserver/env-path.tsboth set out.How it was checked
pnpm typecheckon this branch: exit 0, nothing printed. The same command on an untouched checkout ofmainat289ccb24dies with exit 134 andFATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory, andnode -e "require('v8').getHeapStatistics().heap_size_limit"reports 2240 MB there, which is the ceiling it hits. As a control,NODE_OPTIONS=--max-old-space-size=4096 npx tsc -bon that same untouched checkout exits 0, so the heap is what decides the outcome.pnpm exec vitest run scripts/typecheck.test.mjspasses with four tests: the heap it picks with and withoutNODE_OPTIONSalready set, the two passes in order, and the early stop on the first failure.pnpm exec oxlint --deny-warningsover the files this branch touches reports no warnings and no errors.Notes for reviewers
pnpm typecheckis what the static CI job runs, so that job gets the same heap from now on. Same checks, same verdict, more headroom.I did not run the whole
pnpm testsuite here; the focused test above is the one I ran, and everything else is CI's to run.Based on upstream
mainat289ccb24, whosedevandmainboth still run the baretscpair. No rebase was needed.