-
Notifications
You must be signed in to change notification settings - Fork 22.4k
fix(n8n-nodes-base): split build steps and increase memory limit to prevent OOM crashes #14570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Review this PR on mrge.io |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mrge found 3 issues. View them in mrge.io
@@ -8,7 +8,10 @@ | |||
"copy-nodes-json": "node scripts/copy-nodes-json.js .", | |||
"dev": "pnpm watch", | |||
"typecheck": "tsc --noEmit", | |||
"build": "tsup --tsconfig tsconfig.build.json && pnpm copy-nodes-json && tsc-alias -p tsconfig.build.json && pnpm n8n-copy-static-files && pnpm n8n-generate-translations && pnpm n8n-generate-metadata", | |||
"build": "pnpm build:ts && pnpm build:alias && pnpm build:meta", | |||
"build:ts": "NODE_OPTIONS=--max-old-space-size=8192 tsup --tsconfig tsconfig.build.json", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Memory limit discrepancy between PR description (16384MB) and implementation (8192MB)
@@ -8,7 +8,10 @@ | |||
"copy-nodes-json": "node scripts/copy-nodes-json.js .", | |||
"dev": "pnpm watch", | |||
"typecheck": "tsc --noEmit", | |||
"build": "tsup --tsconfig tsconfig.build.json && pnpm copy-nodes-json && tsc-alias -p tsconfig.build.json && pnpm n8n-copy-static-files && pnpm n8n-generate-translations && pnpm n8n-generate-metadata", | |||
"build": "pnpm build:ts && pnpm build:alias && pnpm build:meta", | |||
"build:ts": "NODE_OPTIONS=--max-old-space-size=8192 tsup --tsconfig tsconfig.build.json", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Environment variable syntax may not be cross-platform compatible
@@ -8,7 +8,10 @@ | |||
"copy-nodes-json": "node scripts/copy-nodes-json.js .", | |||
"dev": "pnpm watch", | |||
"typecheck": "tsc --noEmit", | |||
"build": "tsup --tsconfig tsconfig.build.json && pnpm copy-nodes-json && tsc-alias -p tsconfig.build.json && pnpm n8n-copy-static-files && pnpm n8n-generate-translations && pnpm n8n-generate-metadata", | |||
"build": "pnpm build:ts && pnpm build:alias && pnpm build:meta", | |||
"build:ts": "NODE_OPTIONS=--max-old-space-size=8192 tsup --tsconfig tsconfig.build.json", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Watch mode command not updated with memory limits
Hey @LcCompany, Thanks for the PR, We have created "GHC-1545" as the internal reference to get this reviewed. One of us will be in touch if there are any changes needed, in most cases this is normally within a couple of weeks but it depends on the current workload of the team. |
Summary by mrge
Split the n8n-nodes-base build process into separate steps with increased memory limits to prevent out-of-memory crashes. This change improves build stability in low-memory environments like CI pipelines and self-hosted instances with 2-4 GB of RAM.
Bug Fixes
ERR_WORKER_OUT_OF_MEMORY
errors during builds on memory-constrained systems.--max-old-space-size=8192
flag to Node.js options for critical build steps.Refactors
Splits the
n8n-nodes-base
build script into separate steps (tsup
,tsc-alias
, metadata generation), each with an increased Node.js heap size (--max-old-space-size=16384
).This resolves
ERR_WORKER_OUT_OF_MEMORY
errors that occur during build on low-memory environments such as Render, CI/CD pipelines, and self-hosted instances with 2–4 GB of RAM.How to test:
pnpm run build
in the root monorepo on a machine with limited memory (2–4 GB).packages/nodes-base
without memory-related crashes.dist/
directory remains the same.No changes to runtime logic. This improves developer experience and build stability.
Review / Merge checklist:
✅ PR title and summary are descriptive.
✅ Tests included (no logic changes — build-only).
✅ PR Labeled with release/backport: likely not urgent in this case