diff --git a/src/node-network.ts b/src/node-network.ts index 49f216ee2..d6e12d76d 100644 --- a/src/node-network.ts +++ b/src/node-network.ts @@ -39,7 +39,9 @@ interface ProxyConfig { let installed = false; const directDispatcher = new Agent(); const proxyDispatcherCache = new Map(); -const nativeFetch = globalThis.fetch.bind(globalThis); +const nativeFetch = globalThis.fetch + ? globalThis.fetch.bind(globalThis) + : (input, init) => undiciFetch(input, init); function readEnv(env: NodeJS.ProcessEnv, lower: string, upper: string): string | undefined { const lowerValue = env[lower];