Skip to content

fix(resolver): resolve tsconfig extends with package specifiers via node_modules - #27248

Closed
robobun wants to merge 9 commits into
mainfrom
claude/fix-tsconfig-extends-package-resolution
Closed

robobun wants to merge 9 commits into
mainfrom
claude/fix-tsconfig-extends-package-resolution

resolver: don't pre-persist extends probe paths into dirname_store

2177316
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Apr 18, 2026 in 42m 52s

Code review found 1 important issue

Found 2 candidates, confirmed 2. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 0
🟣 Pre-existing 2
Severity File:Line Issue
🔴 Important src/resolver/resolver.zig:4313-4314 Wrong DirInfo starting point for package extends after relative extends hop
🟣 Pre-existing src/resolver/resolver.zig:4312-4335 Circular tsconfig extends causes BoundedArray overflow with opaque error
🟣 Pre-existing src/resolver/resolver.zig:4312-4334 Circular tsconfig extends silently overflows BoundedArray with opaque error

Annotations

Check failure on line 4314 in src/resolver/resolver.zig

See this annotation in the file changed.

@claude claude / Claude Code Review

Wrong DirInfo starting point for package extends after relative extends hop

In the extends-chain while loop (resolver.zig:4313-4314), resolvePackagePathForTSConfigExtends always passes info — the DirInfo for the directory dirInfoUncached is processing — even after a relative extends hop moves current to a config outside the project directory. Concretely: packages/app/tsconfig.json extends ../../shared/tsconfig.base.json (relative), then shared/tsconfig.base.json extends @scope/config (package); on the second iteration info.abs_path is still packages/app/ while current.a

Check notice on line 4335 in src/resolver/resolver.zig

See this annotation in the file changed.

@claude claude / Claude Code Review

Circular tsconfig extends causes BoundedArray overflow with opaque error

The `while` loop collecting the tsconfig extends chain (resolver.zig:4312–4335) has no cycle detection; a circular project-level chain (e.g., A `extends` B `extends` A) causes `parseTSConfig` to allocate a fresh `*TSConfigJSON` on every iteration until the `BoundedArray(*TSConfigJSON, 64)` overflows after 64 appends, propagating `error.Overflow` through `dirInfoUncached`'s `anyerror\!void` return as an opaque build failure with no user-visible diagnostic. TypeScript emits `error TS18010: Circula

Check notice on line 4334 in src/resolver/resolver.zig

See this annotation in the file changed.

@claude claude / Claude Code Review

Circular tsconfig extends silently overflows BoundedArray with opaque error

The extends-chain collection loop (lines 4312–4334) has no cycle detection; a circular project-level extends chain (e.g. tsconfig.json → base.json → tsconfig.json) causes each config to be re-parsed into BoundedArray(*TSConfigJSON, 64) on every iteration until the 64th append returns error.Overflow, which propagates as a generic build failure with no user-facing diagnostic. This is a pre-existing issue predating the PR, but since the PR rewrites this exact loop to add package-path handling, addi