fix(compile): don't surface graph errors for --include files (#34568)
Files passed to deno compile via --include were added as module graph roots, so when an embedded JS, Wasm or JSON asset contained an unresolvable import (for example a pre-bundled file, or a wasm module with host imports) the whole compilation failed with a graph resolution error, or a type error when type checking was on, instead of just embedding the file. This was a regression from 2.2.6 and made it impossible to embed bundled frontend assets or certain wasm files. This separates the strict graph roots (the entrypoint plus any --preload and --require modules) from the --include module roots. Only the strict roots are validated and type checked, so real errors in the user's program are still reported. The stored module graph is then built from all roots with create_graph, which does not validate, so included files are still transpiled and embedded but their own graph resolution errors no longer fail the build. A consequence is that --include files are treated as best effort assets and are no longer type checked. Fixes #27505
B
Bartek Iwańczuk committed
e832fa75e9328794c76f3813555fb3ad8857cf44
Parent: 812f601
Committed by GitHub <noreply@github.com>
on 5/31/2026, 8:04:08 AM