Is there an existing issue for this?
How do you use Sentry?
Self-hosted/on-premise
Which SDK are you using?
@sentry/nextjs
SDK Version
9.31.0
Framework Version
Next.js 15.3.3
Link to Sentry event
No response
Reproduction Example/SDK Setup
See https://github.com/billyjanitsch/sentry-nextjs-ai-bug for a minimal reproduction.
Steps to Reproduce
See repro readme.
Expected Result
In a server actions file, I expect to be able to import and use server exports from ai/rsc:
"use server";
import { createStreamableValue } from "ai/rsc";
assert(typeof createStreamableValue === 'function')
This works fine in vanilla Next.js.
Actual Result
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.
cc @AbhiPrasad @mydea
Is there an existing issue for this?
How do you use Sentry?
Self-hosted/on-premise
Which SDK are you using?
@sentry/nextjs
SDK Version
9.31.0
Framework Version
Next.js 15.3.3
Link to Sentry event
No response
Reproduction Example/SDK Setup
See https://github.com/billyjanitsch/sentry-nextjs-ai-bug for a minimal reproduction.
Steps to Reproduce
See repro readme.
Expected Result
In a server actions file, I expect to be able to import and use server exports from
ai/rsc:This works fine in vanilla Next.js.
Actual Result
When Sentry's Next.js config is enabled, the above code breaks.
ai/rscresolves to the client implementation instead of the server one, wherecreateStreamableValueis undefined.This happens from
9.30.0onwards, presumably because this version enabled automatic instrumentation of theailibrary.cc @AbhiPrasad @mydea