From 768ef7e638844a0a70c427d17fd9bc015b8d2b6c Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Mon, 26 Jan 2026 13:21:25 +0100 Subject: [PATCH 1/2] fix(node-core): ignore vercel AbortError by default on unhandled rejection --- .../onUnhandledRejectionIntegration/ignore-default.js | 10 +++++++++- .../public-api/onUnhandledRejectionIntegration/test.ts | 2 +- .../node-core/src/integrations/onunhandledrejection.ts | 5 ++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/dev-packages/node-integration-tests/suites/public-api/onUnhandledRejectionIntegration/ignore-default.js b/dev-packages/node-integration-tests/suites/public-api/onUnhandledRejectionIntegration/ignore-default.js index 623aa8eaa8f7..f15c8b387036 100644 --- a/dev-packages/node-integration-tests/suites/public-api/onUnhandledRejectionIntegration/ignore-default.js +++ b/dev-packages/node-integration-tests/suites/public-api/onUnhandledRejectionIntegration/ignore-default.js @@ -13,10 +13,18 @@ class AI_NoOutputGeneratedError extends Error { } } +class AbortError extends Error { + constructor(message) { + super(message); + this.name = 'AbortError'; + } +} + setTimeout(() => { process.stdout.write("I'm alive!"); process.exit(0); }, 500); -// This should be ignored by default and not produce a warning +// These should be ignored by default and not produce a warning Promise.reject(new AI_NoOutputGeneratedError('Stream aborted')); +Promise.reject(new AbortError('Stream aborted')); diff --git a/dev-packages/node-integration-tests/suites/public-api/onUnhandledRejectionIntegration/test.ts b/dev-packages/node-integration-tests/suites/public-api/onUnhandledRejectionIntegration/test.ts index cd0627664ea3..c8570747cf8d 100644 --- a/dev-packages/node-integration-tests/suites/public-api/onUnhandledRejectionIntegration/test.ts +++ b/dev-packages/node-integration-tests/suites/public-api/onUnhandledRejectionIntegration/test.ts @@ -179,7 +179,7 @@ test rejection`); expect(transactionEvent!.contexts!.trace!.span_id).toBe(errorEvent!.contexts!.trace!.span_id); }); - test('should not warn when AI_NoOutputGeneratedError is rejected (default ignore)', () => + test('should not warn when AI_NoOutputGeneratedError or AbortError is rejected (default ignore)', () => new Promise(done => { expect.assertions(3); diff --git a/packages/node-core/src/integrations/onunhandledrejection.ts b/packages/node-core/src/integrations/onunhandledrejection.ts index 42a17e2e6c7e..8b26bc7957d3 100644 --- a/packages/node-core/src/integrations/onunhandledrejection.ts +++ b/packages/node-core/src/integrations/onunhandledrejection.ts @@ -27,8 +27,11 @@ const INTEGRATION_NAME = 'OnUnhandledRejection'; const DEFAULT_IGNORES: IgnoreMatcher[] = [ { - name: 'AI_NoOutputGeneratedError', // When stream aborts in Vercel AI SDK, Vercel flush() fails with an error + name: 'AI_NoOutputGeneratedError', // When stream aborts in Vercel AI SDK V5, Vercel flush() fails with an error }, + { + name: 'AbortError', // When stream aborts in Vercel AI SDK V6 + } ]; const _onUnhandledRejectionIntegration = ((options: Partial = {}) => { From 58839371e96d0eea7ff3150e4e245a630b2f8826 Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Mon, 26 Jan 2026 13:26:57 +0100 Subject: [PATCH 2/2] yarn fix --- packages/node-core/src/integrations/onunhandledrejection.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/node-core/src/integrations/onunhandledrejection.ts b/packages/node-core/src/integrations/onunhandledrejection.ts index 8b26bc7957d3..af40bacfda57 100644 --- a/packages/node-core/src/integrations/onunhandledrejection.ts +++ b/packages/node-core/src/integrations/onunhandledrejection.ts @@ -31,7 +31,7 @@ const DEFAULT_IGNORES: IgnoreMatcher[] = [ }, { name: 'AbortError', // When stream aborts in Vercel AI SDK V6 - } + }, ]; const _onUnhandledRejectionIntegration = ((options: Partial = {}) => {