Skip to content

[9.9.0 regression] Inconsistent resolution of typescript peer-dependency in typescript-eslint packages leads to crash #12079

Description

@andersk

Last pnpm version that worked

9.8.0

pnpm version

11.5.0

Code to reproduce the issue

pnpm i typescript@6.0.3 xo@2.0.2
cd -P node_modules/xo/../typescript-eslint/../@typescript-eslint/eslint-plugin/../..
jq .version typescript/package.json @typescript-eslint/parser/../../typescript/package.json

Expected behavior

$ jq .version typescript/package.json @typescript-eslint/parser/../../typescript/package.json
"5.9.3"
"5.9.3"
flowchart
  A("@typescript-eslint/eslint-plugin") -->|peer-depends| B("@typescript-eslint/parser")
  A -->|peer-depends| C(typescript)
  B -->|peer-depends| C
Loading

@typescript-eslint/eslint-plugin peer-depends typescript, and it also peer-depends @typescript-eslint/parser which peer-depends typescript, so these are expected to resolve to the same version of typescript. This was the behavior of pnpm 9.8.0 and earlier.

Actual behavior

$ jq .version typescript/package.json @typescript-eslint/parser/../../typescript/package.json
"5.9.3"
"6.0.3"

This typescript version mismatch leads to a crash at runtime in xo: TypeError: tsutils.unionConstituents is not a function or its return value is not iterable. For details and reproduction, see

Additional information

This regression was introduced by

Node.js version

24.15.0

Operating System

Linux

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions