mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
fix: loading built-in Node modules embedded in the binary (#17777)
Fixes bug introduced in ed3a7ce2f7
that
caused errors when loading built-in Node modules, when using "deno_graph".
This commit is contained in:
parent
b3c85c3548
commit
1d00bbe47e
5 changed files with 11 additions and 0 deletions
|
@ -534,6 +534,11 @@ impl ProcState {
|
||||||
match maybe_resolved {
|
match maybe_resolved {
|
||||||
Some((found_referrer, Resolution::Ok(resolved))) => {
|
Some((found_referrer, Resolution::Ok(resolved))) => {
|
||||||
let specifier = &resolved.specifier;
|
let specifier = &resolved.specifier;
|
||||||
|
|
||||||
|
if specifier.scheme() == "node" {
|
||||||
|
return node::resolve_builtin_node_module(specifier.path());
|
||||||
|
}
|
||||||
|
|
||||||
if let Ok(reference) = NpmPackageReference::from_specifier(specifier)
|
if let Ok(reference) = NpmPackageReference::from_specifier(specifier)
|
||||||
{
|
{
|
||||||
if !self.options.unstable()
|
if !self.options.unstable()
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
|
import { createRequire } from "node:module";
|
||||||
|
console.log(createRequire);
|
||||||
import process from "node:process";
|
import process from "node:process";
|
||||||
console.log(process.version);
|
console.log(process.version);
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
[Function: createRequire]
|
||||||
v[WILDCARD].[WILDCARD].[WILDCARD]
|
v[WILDCARD].[WILDCARD].[WILDCARD]
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
|
import { createRequire } from "node:module";
|
||||||
|
console.log(createRequire);
|
||||||
import process from "node:process";
|
import process from "node:process";
|
||||||
console.log(process.version);
|
console.log(process.version);
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
[Function: createRequire]
|
||||||
v[WILDCARD].[WILDCARD].[WILDCARD]
|
v[WILDCARD].[WILDCARD].[WILDCARD]
|
||||||
|
|
Loading…
Add table
Reference in a new issue