-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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.18.0
Framework Version
16.0.3
Link to Sentry event
No response
Reproduction Example/SDK Setup
No response
Steps to Reproduce
When deploying a Next.js app that mixes the Pages Router and App Router to Vercel, server-side errors are not consistently reported to Sentry in production, even though the same app works correctly in development and local production builds.
Errors appear in Vercel logs, but corresponding Sentry issues show stale “Last seen” timestamps and no new events.
Pages Router used for pages
App Router used for API routes
No middleware
Sentry tunnel enabled (/monitoring)
Disabling PostHog has no effect
instrumentation.handler.ts and sentry.server.config.ts load correctly locally
Expected Result
Server-side errors should be captured in Sentry regardless of whether the app uses:
-
Pages Router only
-
App Router only
-
A combination of both
Actual Result
Production errors are not reported if both Pages and App Router are used. Mini repo contained in internal ticket #168519
Additional Context
Wondering if this is resulting from the fact that on Vercel in my understanding, mixed Pages Router + App Router apps are deployed as separate serverless execution models, which looks like server-side instrumentation does not consistently attach to all routes when both routers are present. Can someone confirm if this is known, expected or a bug.
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