fix(ci): pin @types/node to restore dtslint, add Node 26 to matrix - #743
Merged
Conversation
All CI jobs were failing at the dtslint step with TS2502 errors in @types/node's web-globals/streams.d.ts: error TS2502: 'CompressionStream' is referenced directly or indirectly in its own type annotation. @types/node@22.19.0 introduced a web-globals/ directory whose streams.d.ts declares globals via a conditional-type/interface merge that TypeScript 4.9 cannot resolve (TS 5.x can). Since @types/node was declared as ^22.9.3, the caret resolved to 22.20.1 and the failure appeared with no change to this repository. Pinning to ~22.18.0 keeps @types/node below 22.19.0, where the offending file does not exist. Verified in clean containers that the failure reproduces and the pin fixes it on Node 9, 12 and 26; lint, unit tests and dtslint pass. Also add Node 26 to the test matrix, verified green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
eitanp461
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every CI job — all 9 Node versions — fails at the
dtslintstep. Unit tests pass first (798–799 passing, 0 failing), then:This affects
masterand therefore every open PR. No repository change caused it.Root cause
@types/node@22.19.0introduced aweb-globals/directory. Itsstreams.d.tsdeclares globals through a conditional-type /interface+varmerge:TypeScript 4.9's checker cannot resolve this and reports TS2502; TS 5.x resolves it fine.
@types/nodewas declared as^22.9.3, so the caret resolved to the newest 22.x (22.20.1) and the break appeared on its own.masterlast went green on 2026-06-18, before 22.19.0 was published.@types/nodedoes ship ats5.6/fallback for older TypeScript, but itstypesVersionsmap only reaches down to<=5.6— TS 4.9 is below that floor, and dtslint resolves the rootweb-globals/files directly, so the fallback cannot help.Fix
Pin
@types/nodeto~22.18.0, keeping it below 22.19.0 where the offending file does not exist. The tilde also prevents the same silent drift from recurring.This is a dev-only change with no production impact:
@types/nodeandtypescriptare bothdevDependencies(the sole runtime dependency islodash), neither is inpackage.json.files, and the package ships plain CommonJS — TypeScript never compiles shipped code.Verification
The failure is dependency-resolution, not Node-version specific. Confirmed in clean Docker containers, changing only the
@types/nodeversion:@types/node22.20.1~22.18.0(this PR)Installing from the edited
package.jsonresolves@types/nodeto 22.18.13 withweb-globals/absent.npm run lint,npm run test:unit(315 passing) andnpm run dtslintall pass.Node 10, 14, 16, 18, 20, 22 and 24 were not tested individually; given identical behaviour at 9, 12 and 26 and that the mechanism is a missing file rather than a runtime feature, they carry no expected risk. Integration tests were already passing before the dtslint step.
Also included
Node 26 added to the test matrix, verified green (full suite in a clean
node:26container).Considered and rejected
Upgrading to TypeScript 5.x also fixes the type error and is the better long-term direction, but TS 5.9 declares
engines: { node: ">=14.17" }— it would break the Node 9, 10 and 12 legs. That needs a supported-versions decision (ask-first perAGENTS.md) and belongs in its own PR.Follow-up worth considering (not in this PR)
package-lock.jsonis gitignored (.gitignore:15), so CI never sees it, and the install step isnpm ci || npm i— with no lockfilenpm cialways fails and silently falls through tonpm i, re-resolving carets against the live registry on every run. That is how this broke with no repository change. This PR closes the current instance; committing the lockfile and using plainnpm ciwould close the class, but it pins all transitive dependencies and can surface unrelated version changes, so it deserves its own PR.🤖 Generated with Claude Code