-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- 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/react-router
SDK Version
10.11.0
Framework Version
React 19.1.1, React Router Framework 7.8.2, AI SDK 5.0.39
Link to Sentry event
No response
Reproduction Example/SDK Setup
https://github.com/w00fz/rr7_aisdk_sentry
Steps to Reproduce
-
Clone the repository
-
Create a
.env
file in the root with your OpenAI API and Sentry DSN keys:OPENAI_API_KEY=sk-... SENTRY_DSN=https://...
-
Install dependencies with
npm install
-
Run the development server with
npm run dev
and verify everything works as expected. Simple chat input should stream back responses from the AI. -
Build the production version with
npm run build
-
Start the production server with
NODE_ENV=production PORT=5173 npm run start
-
Open the app in the browser and try to use the chat input again. You should see the error messages mentioned above.
Example error message from stream
data: {"type":"start","messageId":"34d1d9d5-74fc-4913-ac03-e9b7f8485faa"} data: {"type":"error","errorText":"result.consumeStream is not a function"} data: [DONE]
Change the start command removing the instrumentation and you will see it working as expected.
Expected Result
Stream is captured by the telemetry, visible in Sentry and AI SDK continues streaming back to the client.
Actual Result
Stream is captured by Sentry but appears to be entirely consumed, leading to undesired errors. The error is then streamed back to the client:
result.consumeStream is not a function
result.toUIMessageStream is not a function
Metadata
Metadata
Assignees
Projects
Status