Skip to content

Commit 274628d

Browse files
authored
fix: increase Node.js heap size for Netlify builds (#1446)
## Description - Fix Netlify build failure caused by Node.js running out of heap memory during Vite production build ## Problem The production build was failing with: FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory The build process consumed ~2GB before crashing, exceeding Node's default heap limit. ## Solution Added `NODE_OPTIONS="--max_old_space_size=4096"` to `netlify.toml` build environment, increasing the heap limit to 4GB. ## What type of PR is this? (check all applicable) - [ ] 💡 (feat) - A new feature (non-breaking change which adds functionality) - [ ] 🔄 (refactor) - Code Refactoring - A code change that neither fixes a bug nor adds a feature - [ ] 🐞 (fix) - Bug Fix (non-breaking change which fixes an issue) - [ ] 🏎 (perf) - Optimization - [ ] 📄 (docs) - Documentation - Documentation only changes - [ ] 📄 (test) - Tests - Adding missing tests or correcting existing tests - [ ] ⚙️ (ci) - Continuous Integrations - Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) - [ ] ☑️ (chore) - Chores - Other changes that don't modify src or test files - [ ] ↩️ (revert) - Reverts - Reverts a previous commit(s). <!-- For a timely review/response, please avoid force-pushing additional commits if your PR already received reviews or comments. Before submitting a Pull Request, please ensure you've done the following: - 👷‍♀️ Create small PRs. In most cases this will be possible. - ✅ Provide tests for your changes. - 📝 Use descriptive commit messages (as described below). - 📗 Update any related documentation and include any relevant screenshots. Commit Message Structure (all lower-case): <type>(optional ticket number): <description> [optional body] -->
1 parent e91f4ef commit 274628d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

netlify.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[build.environment]
2+
NODE_OPTIONS = "--max_old_space_size=4096"
3+
14
[[headers]]
25
for = "/*"
36
[headers.values]

0 commit comments

Comments
 (0)