build: raise Node heap for production build - #7
Merged
KarimTamani merged 1 commit intoAug 4, 2026
Conversation
The production build renders thousands of modules and exceeds V8's default heap ceiling, so `npm run build` fails with a JavaScript heap out-of-memory error during "rendering chunks". Set NODE_OPTIONS=--max-old-space-size=8192 on the Vite build step via cross-env (kept portable for Windows), so a fresh clone builds without any manual environment setup. Document the matching Docker memory requirement in DOCKER.md, since the container build hits the same limit when the Docker VM has too little RAM.
KarimTamani
approved these changes
Aug 4, 2026
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.
Description
npm run buildfails with a JavaScript heap out-of-memory error during the "rendering chunks" step, because the app compiles thousands of modules and exceeds V8's default heap ceiling (~2 GB on many machines). The same failure happens inside Docker when the Docker VM has too little RAM.This PR makes the build succeed out of the box:
NODE_OPTIONS=--max-old-space-size=8192on the Vite build step in thebuildscript, viacross-envso it stays portable on Windows.cross-envas a devDependency (pinned to^7.0.3for broad Node compatibility).DOCKER.md, since the container build hits the same limit.Note:
--max-old-space-sizeis a ceiling, not a reservation, so V8 only uses what the build actually needs.Related Issues
None.
Changes Made
Testing
npm run buildOOMs during "rendering chunks" on a machine whose default V8 heap limit is ~2 GB.npm run buildcompletes successfully (verified locally, ~55s) and produces a workingdist/.cross-envcorrectly setsNODE_OPTIONSon the build step.Checklist
Before submitting, please ensure you have:
Additional Notes
This is the minimal fix to unblock the build. A follow-up could reduce peak build memory at the source with
build.rollupOptions.output.manualChunksinvite.config.ts(the build currently emits a single very large chunk, and Vite already warns about it), which would also allow lowering the heap flag. Happy to open that as a separate PR if of interest.