-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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/nextjs
SDK Version
10.38.0 (works correctly on 10.8.0)
Framework Version
Next.js 16.1.6 (Turbopack, production build), Node.js v24.12.0, Prisma 7.x (@prisma/instrumentation ^7.4.0), pnpm workspaces, deployed on AWS ECS Fargate (Debian 12.13)
Link to Sentry event
No response
Reproduction Example/SDK Setup
// sentry.server.config.ts
import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
environment,
tracesSampleRate: 1, // also reproduces with 0
integrations: [
Sentry.prismaIntegration(),
],
});@opentelemetry/api resolves to a single version (1.9.0) across the dependency tree:
dependencies:
@sentry/nextjs 10.38.0
├── @opentelemetry/api 1.9.0
└─┬ @sentry/node 10.38.0
├── @opentelemetry/api 1.9.0
├─┬ @opentelemetry/context-async-hooks 2.5.0
│ └── @opentelemetry/api 1.9.0 peer
├─┬ @opentelemetry/core 2.5.0
│ └── @opentelemetry/api 1.9.0 peer
└─┬ @opentelemetry/instrumentation 0.211.0
└── @opentelemetry/api 1.9.0 peer
Steps to Reproduce
- Create a Next.js 16 app using Turbopack (the default) with
@sentry/nextjs10.38.0 - Deploy to a Node.js 24 environment (we use AWS ECS Fargate)
- The server crashes with
RangeError: Maximum call stack size exceededsometimes within minutes, sometimes after several hours - Setting
tracesSampleRate: 0does not prevent the crash - Setting
skipOpenTelemetrySetup: truedoes not prevent the crash (and introducesMaxListenersExceededWarningfrom all auto-loaded instrumentations stacking listeners on every request) - Downgrading to
@sentry/nextjs10.8.0 with the same Next.js 16.1.6 and Turbopack resolves the issue completely
Expected Result
The application runs stably without stack overflow errors, as it does on SDK version 10.8.0.
Actual Result
The server fatally crashes with an unhandled RangeError: Maximum call stack size exceeded. The stack trace shows two separate bundled copies of @opentelemetry/api in different Turbopack chunks, whose .with() methods recursively call each other.
Additionally, with skipOpenTelemetrySetup: true, the server experiences rapid MaxListenersExceededWarning floods:
MaxListenersExceededWarning: Possible EventEmitter memory leak detected.
11 close listeners added to [ServerResponse]. MaxListeners is 10.
Additional Context
Errors in Sentry are provided in the internal Linear ticket.
Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.
Metadata
Metadata
Assignees
Projects
Status