fix(scripts): use --experimental-strip-types on every Node version#985
fix(scripts): use --experimental-strip-types on every Node version#985carlos-alm merged 1 commit intomainfrom
Conversation
Node 23 briefly shipped a --strip-types alias that was removed in Node 24, so scripts/node-ts.js's major-version gate rejected every script on Node 24 with "node: bad option: --strip-types". This broke npm run build:wasm, deps:tree, and version for any Node 24+ user. --experimental-strip-types is accepted on 22.x, 23.x, and 24.x, so use it unconditionally. Closes #980
|
Claude finished @carlos-alm's task —— View job PR Review CompleteReviewing PR #985: fix(scripts): use --experimental-strip-types on every Node version Todo List:
Root Cause AnalysisProblem Being Solved: Node.js 24 removed the Why This Approach: Using Risk Assessment: Very low risk. This is a targeted compatibility fix that simplifies logic and eliminates a platform-specific failure mode. The author has tested on Node 24.10.0. Backlog Compliance
Critical ConcernsNone. This is a clean, well-justified compatibility fix. Technical ReviewFile Changes (
The implementation is correct, more maintainable, and eliminates a brittle version detection pattern. Affected Commands: Fixes Testing: Author confirmed Final Recommendation
|
Greptile SummaryThis PR fixes a Node 24 regression in Confidence Score: 5/5Safe to merge — minimal, targeted fix with no logic complexity and no regressions introduced. The change is a two-line simplification that removes a broken version-detection branch. --experimental-strip-types is confirmed to work on all targeted Node versions (22–24), the comment is accurate, and no other files are touched. No P0/P1 findings. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[node scripts/node-ts.js script.ts] --> B{Before this PR}
B --> C["major >= 23 ?"]
C -->|"Node 23"| D["--strip-types ✓"]
C -->|"Node 22"| E["--experimental-strip-types ✓"]
C -->|"Node 24"| F["--strip-types ✗ (removed)"]
F --> G["node: bad option: --strip-types 💥"]
A --> H{After this PR}
H --> I["--experimental-strip-types"]
I --> J["Node 22 ✓"]
I --> K["Node 23 ✓"]
I --> L["Node 24 ✓"]
Reviews (1): Last reviewed commit: "fix(scripts): use --experimental-strip-t..." | Re-trigger Greptile |
Summary
scripts/node-ts.jsselected between--strip-typesand--experimental-strip-typesbased on Node major version (major >= 23 ? "--strip-types" : "--experimental-strip-types"). Node 23 briefly shipped--strip-typesas an alias, but Node 24 removed it — on Node 24.10.0 the script fails immediately withnode: bad option: --strip-types, which breaks:npm run build:wasmnpm run deps:treenpm run version--experimental-strip-typesstill works on 22.x, 23.x, and 24.x, so use it unconditionally.Found during
Dogfooding v3.9.4 — see #980
Test plan
node scripts/node-ts.js /tmp/sample.tsruns on Node 24.10.0npm run verify-importssucceeds (routes throughnode-ts.js)npm run lintclean