Skip to content

fix: normalize underscore max old space flags#3540

Closed
immanuwell wants to merge 1 commit intotriggerdotdev:mainfrom
immanuwell:fix-node-options-max-old-space-underscore
Closed

fix: normalize underscore max old space flags#3540
immanuwell wants to merge 1 commit intotriggerdotdev:mainfrom
immanuwell:fix-node-options-max-old-space-underscore

Conversation

@immanuwell
Copy link
Copy Markdown

Summary

Tiny papercut fix: nodeOptionsWithMaxOldSpaceSize() now strips the Node-accepted --max_old_space_size=... form before adding its own heap flag.

Without this, valid NODE_OPTIONS can end up with two heap-size flags. Kinda sneaky, easy to miss.

Related: #1897

Repro

node --max_old_space_size=64 -e "console.log('ok')"

Node 20 accepts that flag. The old helper only removed --max-old-space-size=..., so this input:

--max_old_space_size=4096 --inspect

turned into:

--max_old_space_size=4096 --inspect --max-old-space-size=819

This is triggerable in practice: no cloud quota or hard ceiling blocks it, it is just a valid Node/V8 flag in NODE_OPTIONS. The repo also uses this underscore form in the deploy image code, so yep, it is not just theory.

Tests

pnpm --dir packages/core test src/v3/machines/max-old-space.test.ts --run
pnpm --dir packages/core typecheck

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 10, 2026

🦋 Changeset detected

Latest commit: 84e1bf6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 29 packages
Name Type
@trigger.dev/core Patch
@trigger.dev/build Patch
trigger.dev Patch
@trigger.dev/python Patch
@trigger.dev/redis-worker Patch
@trigger.dev/schema-to-json Patch
@trigger.dev/sdk Patch
@internal/cache Patch
@internal/clickhouse Patch
@internal/llm-model-catalog Patch
@internal/redis Patch
@internal/replication Patch
@internal/run-engine Patch
@internal/schedule-engine Patch
@internal/testcontainers Patch
@internal/tracing Patch
@internal/tsql Patch
@internal/zod-worker Patch
d3-chat Patch
references-d3-openai-agents Patch
references-nextjs-realtime Patch
references-realtime-hooks-test Patch
references-realtime-streams Patch
references-telemetry Patch
@internal/sdk-compat-tests Patch
@trigger.dev/react-hooks Patch
@trigger.dev/rsc Patch
@trigger.dev/database Patch
@trigger.dev/otlp-importer Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 10, 2026

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ec0eeb09-48c4-4f0a-a399-575bd9331f36

📥 Commits

Reviewing files that changed from the base of the PR and between ead1e5a and 84e1bf6.

📒 Files selected for processing (3)
  • .changeset/quiet-pots-relax.md
  • packages/core/src/v3/machines/index.ts
  • packages/core/src/v3/machines/max-old-space.test.ts

Walkthrough

This PR updates the nodeOptionsWithMaxOldSpaceSize function in the core package to normalize both hyphenated and underscored variants of the Node.js --max-old-space-size flag. The regex pattern was changed to match --max[-_]old[-_]space[-_]size=\d+ with global matching, replacing all occurrences instead of just the first. A test case was updated to verify the underscored form is correctly replaced, and a changeset documents the patch release.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

Hi @immanuwell, thanks for your interest in contributing!

This project requires that pull request authors are vouched, and you are not in the list of vouched users.

This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details.

@github-actions github-actions Bot closed this May 10, 2026
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