From 5ae7432b26c96396af2caa121915fcb89e2fdcc7 Mon Sep 17 00:00:00 2001 From: Tony Date: Thu, 26 Mar 2026 21:24:46 +0800 Subject: [PATCH] fix(ofetch): use late-binding fetch in ofetch to ensure request-rewriter intercepts bundled builds (#21518) --- lib/utils/ofetch.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/ofetch.ts b/lib/utils/ofetch.ts index fe5db4b7d..04574ae3e 100644 --- a/lib/utils/ofetch.ts +++ b/lib/utils/ofetch.ts @@ -13,7 +13,7 @@ declare module 'ofetch' { config.enableRemoteDebugging && process.env.NODE_ENV === 'dev' && register(); -const rofetch = createFetch().create({ +const rofetch = createFetch({ fetch: (...args: Parameters) => globalThis.fetch(...args) }).create({ retryStatusCodes: [400, 408, 409, 425, 429, 500, 502, 503, 504], retry: config.requestRetry, retryDelay: 1000,