You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RR7 + AI SDK + Sentry, consumed stream by Sentry leads to AI SDK failure result.consumeStream is not a function #17593
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:
Activity
linear commentedon Sep 11, 2025
JS-925 RR7 + AI SDK + Sentry, consumed stream by Sentry leads to AI SDK failure `result.consumeStream is not a function`
s1gr1d commentedon Sep 11, 2025
Thanks for the reproduction, we're having a look at it :)
RulaKhaled commentedon Sep 11, 2025
Hello, this should be fixed with #17580
w00fz commentedon Sep 11, 2025
Thank you that's awesome! I was able to test your fix and looks like it's all working as expected now. Appreciate the fast response.
Cheers.