From 790726559016c98655bd93c3f223f8ad5e480d41 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 25 Jul 2024 21:40:10 -0400 Subject: fix(node): cjs pkg dynamically importing esm-only pkg fails (#24730) --- ext/node_resolver/resolution.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'ext') diff --git a/ext/node_resolver/resolution.rs b/ext/node_resolver/resolution.rs index d7918c75c..25316c385 100644 --- a/ext/node_resolver/resolution.rs +++ b/ext/node_resolver/resolution.rs @@ -221,10 +221,8 @@ impl NodeResolver { specifier, referrer, referrer_kind, - match referrer_kind { - NodeModuleKind::Esm => DEFAULT_CONDITIONS, - NodeModuleKind::Cjs => REQUIRE_CONDITIONS, - }, + // even though the referrer may be CJS, if we're here that means we're doing ESM resolution + DEFAULT_CONDITIONS, mode, )?; -- cgit v1.2.3