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 } = {