fix(repo): use tsx fallback on Node 26+ for NODE_OPTIONS#1620
fix(repo): use tsx fallback on Node 26+ for NODE_OPTIONS#1620gabroberge wants to merge 1 commit into
Conversation
6cf6bb1 to
58bd3d1
Compare
There was a problem hiding this comment.
No new issues found.
TL;DR — Gates --experimental-transform-types to Node 22.7 through 25.x and falls back to --import tsx on Node 26+, where the flag was removed and is rejected inside NODE_OPTIONS.
Key changes
- Cap experimental-transform-types at Node 25 — predicate is now
(major > 22 && major < 26) || (major === 22 && minor >= 7), so Node26+takes thetsxfallback path. - Extract
versionedFlagsFor(major, minor)— flag selection moves out of the top-level ternary into a named function, with a siblinggetFallbackReason(major)that emits distinct copy for the26+case vs the pre-22.7case.
Summary | 1 file | 1 commit | base: main ← ci/node-26-node-options
Node 26 removes --experimental-transform-types
Before:
addNodeDevOptions()injected--experimental-transform-types --no-warningsintoNODE_OPTIONSfor anymajor > 22, so childnodeprocesses on Node 26+ aborted with--experimental-transform-types is not allowed in NODE_OPTIONS.
After: Node 26+ logs a fallback reason and uses--import tsxinstead, matching the pre-22.7fallback shape.
Verified against the Node v26.1.0 TypeScript docs: the v26.0.0 history entry reads "Removed --experimental-transform-types flag." Type stripping itself remains on by default in 26, but the transform flag is gone — passing it via NODE_OPTIONS is what triggers the error this PR avoids. The single consumer is ark/repo/ts.js, which calls addNodeDevOptions() before spawning a node child via execSync, so the fix lands exactly where it needs to.
Claude Opus | 𝕏

Summary
ark/repo/nodeOptions.js: From Node 26 onward,--experimental-transform-typesis not allowed inNODE_OPTIONS, so anynodechild process started afteraddNodeDevOptions()could fail with:--experimental-transform-types is not allowed in NODE_OPTIONS.(major > 22 && major < 26) || (major === 22 && minor >= 7)so 26+ uses the--import tsxfallback (same broad approach as pre–22.7).versionedFlagsFor(major, minor); the fallback path logsgetFallbackReason(major)(distinct copy for 26+ vs other fallback cases) then returns"--import tsx".Test plan
pnpm buildon Node 26+ (or rely on CIcompatibility (ubuntu-latest, latest))--experimental-transform-types --no-warningsNote
Scope: minimal fix so CI passes on Node 26+; not a broader build refactor.
I’m not asserting we should keep
tsxfor Node ≥ 26 forever—only that it unblocks today’sNODE_OPTIONSrestriction. Maintainers can propose a native or alternative approach when they see fit.