From acecd80afa243d941cc556fc7d29c6c7aecd1729 Mon Sep 17 00:00:00 2001 From: Adib234 <30782825+Adib234@users.noreply.github.com> Date: Fri, 26 Dec 2025 11:37:13 -0500 Subject: [PATCH] Resolve unhandled promise rejection in ide-client.ts (#15587) --- packages/core/src/ide/ide-client.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/core/src/ide/ide-client.ts b/packages/core/src/ide/ide-client.ts index 7523a09a93..1203610d40 100644 --- a/packages/core/src/ide/ide-client.ts +++ b/packages/core/src/ide/ide-client.ts @@ -678,6 +678,9 @@ export class IdeClient { noProxy: [existingNoProxy, '127.0.0.1'].filter(Boolean).join(','), }); const undiciPromise = import('undici'); + // Suppress unhandled rejection if the promise is not awaited immediately. + // If the import fails, the error will be thrown when awaiting undiciPromise below. + undiciPromise.catch(() => {}); return async (url: string | URL, init?: RequestInit): Promise => { const { fetch: fetchFn } = await undiciPromise; const fetchOptions: RequestInit & { dispatcher?: unknown } = {