Skip to content

fix(v10/nextjs): Include basePath in request url of Pages Router errors - #25064

Merged
chargome merged 2 commits into
v10from
backport/v10-nextjs-pages-router-basepath-request-url
Oct 6, 2026
Merged

chargome merged 2 commits into
v10from
backport/v10-nextjs-pages-router-basepath-request-url

Conversation

@chargome

@chargome chargome commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Backport of: #24985

Differences to the original PR

  • packages/nextjs/src/common/pages-router-instrumentation/wrapApiHandlerWithSentry.ts: v10 still has the older API route wrapper that starts its own http.server span, so the swap to pagesRouterRequestToRequestData lands on the normalizedRequest used there instead of the inline setSDKProcessingMetadata call. Because that span builds url.full and url.path from the same request data, on v10 those span attributes also include the basePath now.
  • dev-packages/e2e-tests/test-applications/nextjs-15-basepath/tests/pages-router-request-url.test.ts: v10 does not stream spans by default, so the tests wait for the http.server transaction and check its request.url instead of the streamed segment span's url.full. The transaction's request.url has no query string (it is in query_string), so the assertion leaves it out.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.23 kB added added
@sentry/browser - with treeshaking flags 26.66 kB added added
@sentry/browser (incl. Tracing) 47.12 kB added added
@sentry/browser (incl. Tracing + Span Streaming) 48.91 kB added added
@sentry/browser (incl. Tracing, Profiling) 51.89 kB added added
@sentry/browser (incl. Tracing, Replay) 86.45 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 76.08 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 91.18 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 103.81 kB added added
@sentry/browser (incl. Feedback) 45.4 kB added added
@sentry/browser (incl. sendFeedback) 33.03 kB added added
@sentry/browser (incl. FeedbackAsync) 38.16 kB added added
@sentry/browser (incl. Metrics) 29.31 kB added added
@sentry/browser (incl. Logs) 29.54 kB added added
@sentry/browser (incl. Metrics & Logs) 30.23 kB added added
@sentry/react 30.02 kB added added
@sentry/react (incl. Tracing) 49.43 kB added added
@sentry/vue 34.03 kB added added
@sentry/vue (incl. Tracing) 49.5 kB added added
@sentry/svelte 28.25 kB added added
CDN Bundle 30.58 kB added added
CDN Bundle (incl. Tracing) 49.07 kB added added
CDN Bundle (incl. Logs, Metrics) 32.16 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 50.39 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 71.52 kB added added
CDN Bundle (incl. Tracing, Replay) 86.69 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.95 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 92.51 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 93.78 kB added added
CDN Bundle - uncompressed 90.96 kB added added
CDN Bundle (incl. Tracing) - uncompressed 147.96 kB added added
CDN Bundle (incl. Logs, Metrics) - uncompressed 95.67 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 151.94 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 220.7 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 267.46 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.43 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 281.16 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.12 kB added added
@sentry/nextjs (client) 51.96 kB added added
@sentry/sveltekit (client) 47.57 kB added added
@sentry/core/server 81.14 kB added added
@sentry/core/browser 67.27 kB added added
@sentry/node-core 63.87 kB added added
@sentry/node 126.57 kB added added
@sentry/node (incl. diagnostics channel injection) 170.72 kB added added
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B added added
@sentry/node/light 51.98 kB added added
@sentry/node - without tracing 75.63 kB added added
@sentry/aws-serverless 84.81 kB added added
@sentry/cloudflare (withSentry) - minified 204.66 kB added added
@sentry/cloudflare (withSentry) 504.61 kB added added

…sePath e2e

v10 does not stream spans by default, so the server request is sent as a
transaction rather than a streamed segment span.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chargome
chargome marked this pull request as ready for review October 6, 2026 08:14
@chargome
chargome requested a review from a team as a code owner October 6, 2026 08:14
@chargome
chargome requested review from nicohrubec and s1gr1d and removed request for a team October 6, 2026 08:14
@chargome
chargome merged commit b112f04 into v10 Oct 6, 2026
89 of 90 checks passed
@chargome
chargome deleted the backport/v10-nextjs-pages-router-basepath-request-url branch October 6, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants