From 42cdbc79654d90b3edce747ea044513f2f964958 Mon Sep 17 00:00:00 2001 From: Jiayong Date: Wed, 7 Dec 2022 07:09:43 -0500 Subject: [PATCH] fix: use `globalThis.fetch` in `ctx.fetch` utility (#1490) fix: change the `fetch` reference in useFetch function Co-authored-by: Artem Zakharchenko --- src/context/fetch.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context/fetch.ts b/src/context/fetch.ts index 0121fdeb7..6d91a756d 100644 --- a/src/context/fetch.ts +++ b/src/context/fetch.ts @@ -8,7 +8,7 @@ const useFetch: (input: RequestInfo, init?: RequestInit) => Promise = import('node-fetch').then(({ default: nodeFetch }) => (nodeFetch as unknown as typeof window.fetch)(input, init), ) - : window.fetch + : globalThis.fetch export const augmentRequestInit = (requestInit: RequestInit): RequestInit => { const headers = new Headers(requestInit.headers)