Skip to content

@sentry/nextjs automatic ai instrumentation breaks ai/rsc #16725

Open
@billyjanitsch

Description

@billyjanitsch

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

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy