deno
1d4e6c1c - fix(check): load a single @types/node (#35641)

Commit
1 day ago
fix(check): load a single @types/node (#35641) When a project provides its own `@types/node`, the type-checker loaded it **and** the built-in copy that backs `lib="node"`. With a single global symbol table that means every node declaration (`process`, `Buffer`, `node:path`, the `Server` / `Console` / etc. types) is declared twice. The current forked compiler hides this with its dual node/deno global tables, but it's a latent double-load and a blocker for moving to a single global table. This resolves the user's `@types/node` once (from the project) and references the resolved file directly from `lib.node.d.ts`, so exactly one copy ends up in the program. When the project has no `@types/node`, the built-in copy is served as before, so the default experience is unchanged. The resolved path is referenced directly instead of re-emitting `/// <reference types="npm:@types/node" />`, because the latter would be re-resolved relative to the `asset:///lib.node.d.ts` file rather than the project, which fails for cache-only / `--frozen` installs (the package is known from the lockfile but not under `node_modules`).
Author
Parents
Loading