From ee06f83988bd472b93351ff7f86a17ad8484ba92 Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Tue, 17 Mar 2026 12:59:18 -0400 Subject: [PATCH] fix(proxy): support portable undici dispatcher typings --- src/utils/fetch-proxy-setup.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/fetch-proxy-setup.ts b/src/utils/fetch-proxy-setup.ts index 604025ed..b52c6d74 100644 --- a/src/utils/fetch-proxy-setup.ts +++ b/src/utils/fetch-proxy-setup.ts @@ -9,6 +9,8 @@ import { Agent, Dispatcher, ProxyAgent, fetch as undiciFetch, setGlobalDispatche import { getProxyResolution, shouldBypassProxy } from './proxy-env'; const FETCH_PROXY_PROTOCOLS = ['http:', 'https:']; +type RoutingDispatchOptions = Parameters[0]; +type RoutingDispatchHandler = Parameters[1]; type GlobalFetchProxyConfig = { httpProxyUrl?: string; @@ -27,7 +29,7 @@ class RoutingProxyDispatcher extends Dispatcher { this.httpsProxyDispatcher = httpsProxyUrl ? new ProxyAgent(httpsProxyUrl) : null; } - dispatch(options: Dispatcher.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean { + dispatch(options: RoutingDispatchOptions, handler: RoutingDispatchHandler): boolean { return this.resolveDispatcher(options.origin).dispatch(options, handler); }