#4962·antlr4

TypeScript runtime tests fail in CI since ~April: ts-node incompatible with typescript@latest (TS 7)

Author: analog-cbarberCreated Jul 25, 2026Updated Jul 25, 2026

Every build (*, typescript) CI job currently fails, on every PR that triggers them. Each test dies at the Execute stage, before any ANTLR code runs, with:

TypeError: Cannot read properties of undefined (reading 'fileExists')
    at readConfig (.../ts-node/dist/configuration.js:91:33)

Cause

The test harness installs its toolchain unpinned (TsNodeRunner.java):

java
Processor.run(new String[] {NPM_EXEC, "--silent", "install", "-g", "typescript", "ts-node", "webpack", "webpack-cli"}, null);

npm's typescript@latest is now the TypeScript 7 (Go-based) rewrite, which no longer exposes the ts.sys internal API that ts-node 10.9.x (unmaintained since 2022) reaches into — ts-node crashes on startup before compiling anything.

Evidence it's the toolchain, not the tree

  • dev tip 7d5770395 passed all three typescript jobs on 2026-02-16 (run 22078029856); the identical tree fails them today.
  • The failure appears on every full-matrix PR regardless of content: #4943, #4947, #4949, #4953, #4954, #4961. PRs that look green (e.g. #4957–#4960) simply didn't trigger the typescript jobs, so the breakage is easy to miss.
  • Reproduced locally with the harness setup (ESM package.json + helper tsconfig + a test file importing antlr4): ts-node under [email protected] fails with exactly the CI error; the same file runs fine under an executor that doesn't use the TypeScript compiler API.

Fix options

  1. Swap ts-node for tsx (esbuild-based, no dependency on TypeScript's compiler API, actively maintained) — structurally immune to TypeScript's release cadence. PR to follow.
  2. Pin the install (typescript@5 [email protected]) — also goes green today, but freezes the tests to an aging TypeScript under an unmaintained runner.

Diagnosis developed with AI assistance (Claude Fable 5); I reviewed and reproduced it.