Skip to content

fix(scripts): use --experimental-strip-types on every Node version#985

Merged
carlos-alm merged 1 commit intomainfrom
fix/node-ts-strip-types-flag
Apr 21, 2026
Merged

fix(scripts): use --experimental-strip-types on every Node version#985
carlos-alm merged 1 commit intomainfrom
fix/node-ts-strip-types-flag

Conversation

@carlos-alm
Copy link
Copy Markdown
Contributor

Summary

scripts/node-ts.js selected between --strip-types and --experimental-strip-types based on Node major version (major >= 23 ? "--strip-types" : "--experimental-strip-types"). Node 23 briefly shipped --strip-types as an alias, but Node 24 removed it — on Node 24.10.0 the script fails immediately with node: bad option: --strip-types, which breaks:

  • npm run build:wasm
  • npm run deps:tree
  • npm run version

--experimental-strip-types still 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.ts runs on Node 24.10.0
  • npm run verify-imports succeeds (routes through node-ts.js)
  • npm run lint clean

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
Copy link
Copy Markdown

claude Bot commented Apr 21, 2026

Claude finished @carlos-alm's task —— View job


PR Review Complete

Reviewing PR #985: fix(scripts): use --experimental-strip-types on every Node version

Todo List:

  • Read and analyze the changed file (scripts/node-ts.js)
  • Verify Node.js flag compatibility claims
  • Conduct Phase 1: Root Cause Analysis
  • Conduct Phase 2: Configuration Change Detection
  • Conduct Phase 3: Test Integrity Check
  • Conduct Phase 4: Code Quality Review
  • Conduct Phase 5: Backlog Compliance Assessment
  • Provide final rating and recommendation

Root Cause Analysis

Problem Being Solved: Node.js 24 removed the --strip-types flag that was briefly introduced as an alias in Node 23, breaking build scripts that selected flags based on Node version detection.

Why This Approach: Using --experimental-strip-types unconditionally is the correct solution because it works consistently across all supported Node versions (22.x, 23.x, 24.x). The previous version detection logic was fragile and unnecessary.

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

  • Zero-dep: ✓ — No new dependencies added
  • Foundation-aligned: ✓ — Maintains principle P1 (always-current graph) by fixing build breakage that would prevent incremental rebuilds
  • Problem-fit: 2 — Infrastructure maintenance that enables core functionality but doesn't directly address AI agent token waste/orientation issues
  • Breaking: No — Internal script change, no API surface affected
  • Tier: 1

Critical Concerns

None. This is a clean, well-justified compatibility fix.

Technical Review

File Changes (scripts/node-ts.js):

  • Line 3: Updated comment correctly explains the compatibility issue
  • Line 4-5: Accurate documentation of the Node 23→24 flag removal
  • Line 10: Simplified from version detection logic to constant flag
  • Lines 11-26: Unchanged execution logic

The implementation is correct, more maintainable, and eliminates a brittle version detection pattern.

Affected Commands: Fixes npm run build:wasm, npm run deps:tree, npm run version on Node 24+.

Testing: Author confirmed node scripts/node-ts.js /tmp/sample.ts works on Node 24.10.0, and npm run verify-imports (which routes through this script) succeeds.

Final Recommendation

  • Rating: ⭐⭐⭐⭐☆ (4/5)
  • Action: APPROVE
  • Reasoning: Clean compatibility fix that addresses a real platform regression. Well-documented, properly tested, no architectural concerns. Loses one star only due to low problem-fit score (infrastructure maintenance vs core feature).

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 21, 2026

Greptile Summary

This PR fixes a Node 24 regression in scripts/node-ts.js where --strip-types (introduced as an alias in Node 23) was removed in Node 24, causing node: bad option: --strip-types on startup. The fix drops the version-detection branch and unconditionally uses --experimental-strip-types, which is accepted across all supported Node versions (22.x, 23.x, and 24.x).

Confidence Score: 5/5

Safe 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

Filename Overview
scripts/node-ts.js Removes Node version detection and hardcodes --experimental-strip-types, which works on Node 22.x–24.x; fixes immediate breakage on Node 24 where --strip-types was removed.

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 ✓"]
Loading

Reviews (1): Last reviewed commit: "fix(scripts): use --experimental-strip-t..." | Re-trigger Greptile

@carlos-alm carlos-alm mentioned this pull request Apr 21, 2026
2 tasks
@carlos-alm carlos-alm merged commit 937e734 into main Apr 21, 2026
23 checks passed
@carlos-alm carlos-alm deleted the fix/node-ts-strip-types-flag branch April 21, 2026 03:03
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant