fix(ofetch): use late-binding fetch in ofetch to ensure request-rewriter intercepts bundled builds (#21518)

This commit is contained in:
Tony
2026-03-26 21:24:46 +08:00
committed by GitHub
parent 3086b7784f
commit 5ae7432b26
+1 -1
View File
@@ -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<typeof fetch>) => globalThis.fetch(...args) }).create({
retryStatusCodes: [400, 408, 409, 425, 429, 500, 502, 503, 504],
retry: config.requestRetry,
retryDelay: 1000,