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
@sentry/nextjs automatic ai instrumentation breaks ai/rsc #16725
When Sentry's Next.js config is enabled, the above code breaks. ai/rsc resolves to the client implementation instead of the server one, where createStreamableValue is undefined.
This happens from 9.30.0 onwards, presumably because this version enabled automatic instrumentation of the ai library.
Thank you for reaching out and reporting this issue!
The problem stems from a recent change we made where we added the ai package to our list of externalized packages for instrumentation purposes. Unfortunately this causes Next.js to incorrectly evaluate the Vercel AI SDK's conditional exports, specifically the react-server export condition isn't properly handled when the package is externalized, resulting in client-side code being loaded in server components instead of the server-side functions.
I've identified a potential fix and will be working on it, we'll ping you with updates.
@alvarlagerlof I'm not sure. We will look at the other issue and evaluate it.
@billyjanitsch Regarding this, I merged the fix removing the package from the list of externalized packages. With the upcoming release could you please test this and see if it works?
Reacted by Alvar Lagerlöf, Billy Janitsch and QuinnStraus
Activity
RulaKhaled commentedon Jun 25, 2025
Thank you for reaching out and reporting this issue!
The problem stems from a recent change we made where we added the
aipackage to our list of externalized packages for instrumentation purposes. Unfortunately this causes Next.js to incorrectly evaluate the Vercel AI SDK's conditional exports, specifically thereact-serverexport condition isn't properly handled when the package is externalized, resulting in client-side code being loaded in server components instead of the server-side functions.I've identified a potential fix and will be working on it, we'll ping you with updates.
alvarlagerlof commentedon Jun 25, 2025
@RulaKhaled Do you think that your potential fix would fix this too?
RulaKhaled commentedon Jun 26, 2025
@alvarlagerlof I'm not sure. We will look at the other issue and evaluate it.
@billyjanitsch Regarding this, I merged the fix removing the package from the list of externalized packages. With the upcoming release could you please test this and see if it works?
mydea commentedon Jun 27, 2025
We have released 9.33.0 which removes
aifrom externals again, which should fix the problem. Please reopen the issue if you still run into any issues!