SIGN IN SIGN UP
denoland / deno UNCLAIMED

A modern runtime for JavaScript and TypeScript.

0 0 30 Rust

fix(compile): embed workspace package.json files in the VFS (#34530)

Compiling a project that imports a non-Deno workspace member by its
package name, where the member is described by a package.json with an "exports"
map, produced a binary that failed at runtime with ERR_MODULE_NOT_FOUND.
Instead of honoring the exports target it resolved the bare "<dir>/index.js",
because the workspace package.json files were only embedded into the virtual
filesystem for the byonm npm resolver. With a managed resolver (for example
"nodeModulesDir": "auto"), or with no npm packages at all, the file was missing from the
VFS, so the runtime node resolver could not read the exports field and fell back
to legacy index.js resolution.

This embeds the workspace package.json files unconditionally, before the
npm resolver branch runs, so the exports map is available at runtime
regardless of npm mode. This covers exports maps that point at either a built .js file
or a .ts source file, and members that are themselves package.json packages.
The runtime type-checking gap for these members (TS2307) is a separate
resolver issue and is left for a follow-up; the spec tests use --no-check to
isolate the runtime resolution behavior.

Fixes #28926
Fixes #27315
B
Bartek Iwańczuk committed
5ff8b7eaa4c176b8fe1f877a063e73b59e1c4fcd
Parent: e07f52b
Committed by GitHub <noreply@github.com> on 5/30/2026, 6:57:13 AM