deno
e2feae55 - fix(ext/node): skip user module.register() load hooks for node:/ext: builtins (#34006)

Commit
73 days ago
fix(ext/node): skip user module.register() load hooks for node:/ext: builtins (#34006) Fixes #34004. When `module.register()` is active, importing a `node:` built-in (e.g. `node:path`) from an npm package was routed through the JS-side load-hook bridge. The hook chain's `defaultLoad` returns `{ source: null, format: "builtin" }` for `node:` URLs, which falls through to the default Rust loader. That loader doesn't understand the `node:` scheme and surfaces an `Unsupported scheme "node"` error — the exact failure mode reported in #34004 during `vite build` of a Fresh app that transitively calls `register()` via `@tailwindcss/postcss`. The resolve path already short-circuits `node:` / `ext:` specifiers via `is_already_resolved_specifier` (added in #33920). This applies the same treatment to the load path: built-in modules are served by the runtime's module map and must never be sent through user-supplied hooks. `is_builtin_module_specifier` is factored out so the two call sites share the exact same predicate. Co-authored-by: lunadogbot <lunadogbot@users.noreply.github.com>
Author
Parents
Loading