From be0ada3e86a3b22f050f9dd6014dbbe6f9db0bac Mon Sep 17 00:00:00 2001 From: Khafra Date: Wed, 4 Oct 2023 16:59:38 -0400 Subject: [PATCH] lib: let deps require `node` prefixed modules fixup --- lib/internal/bootstrap/realm.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/internal/bootstrap/realm.js b/lib/internal/bootstrap/realm.js index f9d096ca963464..52c0176b882500 100644 --- a/lib/internal/bootstrap/realm.js +++ b/lib/internal/bootstrap/realm.js @@ -426,7 +426,9 @@ function requireBuiltin(id) { // Allow internal modules from dependencies to require // other modules from dependencies by providing fallbacks. function requireWithFallbackInDeps(request) { - if (!BuiltinModule.map.has(request)) { + if (StringPrototypeStartsWith(request, 'node:')) { + request = BuiltinModule.normalizeRequirableId(request); + } else if (!BuiltinModule.map.has(request)) { request = `internal/deps/${request}`; } return requireBuiltin(request);