### Is there an existing issue for this? - [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues - [x] I have reviewed the documentation https://docs.sentry.io/ - [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases ### How do you use Sentry? Sentry Saas (sentry.io) ### Which SDK are you using? @sentry/browser ### SDK Version 10.13.0 ### Framework Version NodeJS 20.19.0 ### Link to Sentry event _No response_ ### Reproduction Example/SDK Setup ```typescript Sentry.init({ dsn: Config.SENTRY_DSN, integrations: [ // Add the OpenAI integration Sentry.openAIIntegration({ recordInputs: true, recordOutputs: true, }), Sentry.anthropicAIIntegration({ recordInputs: true, recordOutputs: true, }) ], tracesSampleRate: sampleRate, profilesSampleRate: sampleRate, environment: environmentName }) ``` ### Steps to Reproduce 1. Install @sentry/node v10.7.0 or later 2. Initialize Anthropic 3. Call `anthropic.messages.stream()` with streaming parameters using `.on()` event handlers ```typescript import Anthropic from '@anthropic-ai/sdk'; const client = new Anthropic(); const stream = await client.messages.stream(streamParams) .on('streamEvent', (messageStreamEvent, snapshot) => { // Handle streamEvent }) ``` ### Expected Result Call succeeds and sends message to Anthropic, while listening for `streamEvent` type. ### Actual Result Error thrown with message: > TypeError: this.anthropic.messages.stream(...).on is not a function ### Additional Context Event handlers (i.e. `.on()`) are consistent with Anthropic's [docs on streaming messages](https://docs.claude.com/en/docs/build-with-claude/streaming#streaming-with-sdks) using their Node SDK. This worked fine in @sentry/node v10.6.0 but has been broken since v10.7.0. It may be related to this PR: https://github.com/getsentry/sentry-javascript/pull/17460 <sub>Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it.</sub>
Activity
linear commentedon Sep 22, 2025
JS-964 Anthropic message stream events unhandled
andreiborza commentedon Sep 23, 2025
Hi @adoxner, thank you for filing this, we'll investigate.
fix(core): Prevent `instrumentAnthropicAiClient` breaking MessageStre…
github-actions commentedon Sep 29, 2025
A PR closing this issue has just been released 🚀
This issue was referenced by PR #17754, which was included in the 10.16.0 release.