File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3086,7 +3086,6 @@ export function buildModuleResolutionBridgeHandlers(
30863086 }
30873087
30883088 // Try require.resolve first
3089- if ( req === "undici" ) console . error ( `[DEBUG resolve undici] hostDir=${ hostDir } sandboxDir=${ sandboxDir } referrer=${ referrer } ` ) ;
30903089 try {
30913090 const resolved = hostRequire . resolve ( req , { paths : [ hostDir ] } ) ;
30923091 return deps . hostToSandboxPath ( resolved ) ;
@@ -3109,6 +3108,13 @@ export function buildModuleResolutionBridgeHandlers(
31093108 const resolved = resolveFromExports ( realDir ) ;
31103109 if ( resolved ) return resolved ;
31113110 } catch { /* fallback failed */ }
3111+
3112+ // Last resort: try resolving from the host process itself (no path restrictions).
3113+ // This handles Node.js-bundled packages like undici that aren't in node: namespace.
3114+ try {
3115+ const resolved = hostRequire . resolve ( req ) ;
3116+ return deps . hostToSandboxPath ( resolved ) ;
3117+ } catch { /* truly not found */ }
31123118 return null ;
31133119 } ;
31143120
You can’t perform that action at this time.
0 commit comments