Skip to content
This repository was archived by the owner on Oct 4, 2026. It is now read-only.
This repository was archived by the owner on Oct 4, 2026. It is now read-only.

Web mode boot still fails on Node v22 after #1864 fix — ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING #2333

Closed

Description

@navin-moorthy

Problem

gsd --web fails to start on Node.js v22.13.0 with the same ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING error that #1864 was meant to fix. The fix in v2.42.0 switches from --experimental-strip-types to --experimental-transform-types when the package root is under node_modules/, but Node 22 blocks both flags for files under node_modules/.

The boot readiness check returns HTTP 500 three times, then aborts (the bug 2/3 fixes from #1864 work correctly — fast fail and error body are present).

Root Cause

resolveTypeStrippingFlag() doesn't help on Node 22

The fix in #1864 added resolveTypeStrippingFlag() (chunk 34431 in the standalone bundle):

function d(a) {
  return a.replace(/\\/g, "/").includes("/node_modules/") && function () {
    let [a, b] = process.versions.node.split(".").map(Number);
    return a > 22 || 22 === a && b >= 7;
  }() ? "--experimental-transform-types" : "--experimental-strip-types";
}

On Node 22.13.0, this correctly returns --experimental-transform-types. However, Node 22 enforces ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING for both flags — the restriction applies to all native TypeScript handling for files under node_modules/, not just strip-types.

Verified directly:

$ node --version
v22.13.0

$ node --experimental-transform-types -e \
  "require('/path/to/node_modules/gsd-pi/src/resources/extensions/gsd/auto-dashboard.ts')"

Error [ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING]: Stripping types is currently
unsupported for files under node_modules, for
"/Users/navin/.proto/tools/node/globals/lib/node_modules/gsd-pi/src/resources/extensions/gsd/auto-dashboard.ts"

The subprocess in module 74900 (chunks/229.js) spawns:

execFile(process.execPath, [
  "--import", resolve_ts_mjs_url,
  resolveTypeStrippingFlag(packageRoot),  // ← "--experimental-transform-types" on 22.13
  "--input-type=module",
  "--eval", script_that_imports_auto_ts
], ...)

The --import resolve-ts.mjs registers a dist-redirect.mjs loader hook, but this doesn't bypass Node's pre-import type stripping check.

This restriction was only lifted in Node 23.6+

The ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING check for --experimental-transform-types was removed in nodejs/node#56785 (landed in Node 23.6). Node 22 LTS still enforces it for both flags.

Expected Behavior

The fix from #1864 should work on Node 22 LTS (current LTS line). Options:

  1. Pre-compile src/resources/extensions/gsd/*.ts to JS at package build time, so subprocess workers import .js files that bypass the restriction entirely.
  2. Copy .ts files to a temp dir outside node_modules/ before spawning subprocesses.
  3. Document Node 23.6+ / 24 as the minimum for web mode if supporting Node 22 isn't feasible.

Environment

Reproduction

# Node 22 LTS
node -v  # v22.13.0

# Install or update to latest
npm update -g gsd-pi  # 2.43.0

# Launch web mode
cd /path/to/any/project
gsd --web
# → boot-ready:boot route returned 3 consecutive 5xx responses (last: 500)

Forensic Evidence

  • resolveTypeStrippingFlag() correctly detects node_modules/ path and returns --experimental-transform-types
  • Node 22.13.0 throws ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING for both --experimental-strip-types and --experimental-transform-types
  • The node-pty package bundled in the standalone also ships raw .ts source files in src/, though this is secondary to the auto.ts subprocess issue
  • Bugs 2 and 3 from Web mode boot fails with HTTP 500 on Node v24 — ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING #1849 are confirmed fixed — fast fail after 3 consecutive 5xx and error body are present

Refs: #1849, #1856, #1864

Activity

  1. self-assigned this
    on Mar 24, 2026
  2. trek-e commented on Mar 24, 2026

    @trek-e
    Contributor

    This is addressed by PR #2320 which resolves all 14 web subprocess module paths to compiled .js when under node_modules. If still failing after updating, please reopen with Node version details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions