GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(nextjs): Emit the tunnel route handler by logaretm · Pull Request #25424 · getsentry/sentry-javascript

Conversation

@logaretm

@logaretm logaretm commented Oct 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This overhauls the tunnel implementation of Next.js by doing a few things:

  • Making the implementation use the same logic we have in the other frameworks/core, so it inherits:
    • The randomization is DSN based.
    • Proper forwarding for client IP and several headers.
    • Memory optimizations due to streaming the request/response.
  • We now spit a route file with the route, fully capitalizing on Sigrid's feat(nextjs): Add a tunnel route handler that sends only the event payload to Sentry #25456 this means:
    • No need to have omit for the transport options.

The way it works varies depeding on how the user deploys their application.

On Conventional Servers/Platforms

Our runtime patchers introduced in this stack handle the tunnel request, the user's Next.js app never handles any of these.

On Vercel

We utilize the two-hop idea we did in #25456 by writing a small idempotent app router file. The re-write rules move traffic to the new handler, and the file exports a POST handler for the route.

// Generated by @sentry/nextjs for the managed tunnel on Vercel.
export { POST } from '@sentry/nextjs/tunnel';

Vercel applies certain rules and responds with 404 for tunnel requests that aren't present in re-writes or app router, so our runtime patchers will never trigger. Which is why this workaround was needed.

For everyone else, the runtime patchers will work.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@logaretm
logaretm added this pull request to stack #25201 October 15, 2026 20:01
@github-actions

github-actions Bot commented Oct 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: 02b3743 (PR test merge using develop at 1873c1d)

Against: 1873c1d (develop) · base run #65687

✅ Baseline matches: this diff contains only this PR's changes.

Path Size % Change Change
@sentry/browser 29.98 kB - -
@sentry/browser - with treeshaking flags 28.13 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.02 kB - -
@sentry/browser (incl. Tracing) 52.36 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 52.36 kB - -
@sentry/browser (incl. Tracing, Profiling) 55.33 kB - -
@sentry/browser (incl. Tracing, Replay) 92.76 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 81.41 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 97.49 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 110.48 kB - -
@sentry/browser (incl. Feedback) 47.57 kB - -
@sentry/browser (incl. sendFeedback) 35.07 kB - -
@sentry/browser (incl. FeedbackAsync) 40.18 kB - -
@sentry/browser (incl. Metrics) 31.54 kB - -
@sentry/browser (incl. Logs) 31.83 kB - -
@sentry/browser (incl. Metrics & Logs) 32.52 kB - -
@sentry/react 31.84 kB - -
@sentry/react (incl. Tracing) 54.8 kB - -
@sentry/vue 38.39 kB - -
@sentry/vue (incl. Tracing) 55.38 kB - -
@sentry/svelte 30 kB - -
@sentry/remix (Remix 3 client bundle) 57.97 kB - -
CDN Bundle 31.77 kB - -
CDN Bundle (incl. Tracing) 52.94 kB - -
CDN Bundle (incl. Logs, Metrics) 34.58 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 55.45 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 76.05 kB - -
CDN Bundle (incl. Tracing, Replay) 91.22 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 93.77 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 97.34 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 99.93 kB - -
CDN Bundle - uncompressed 92.89 kB - -
CDN Bundle (incl. Tracing) - uncompressed 156.15 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 101.42 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 163.92 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 233.31 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 278.17 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 285.93 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 291.87 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 299.63 kB - -
@sentry/nextjs (client) 57.74 kB -0.08% -44 B 🔽
@sentry/sveltekit (client) 52.88 kB - -
@sentry/core/server 44.51 kB - -
@sentry/core/browser 14.02 kB - -
@sentry/node 157.8 kB +0.02% +16 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.31 kB - -
@sentry/node - without tracing 97.23 kB +0.02% +18 B 🔺
@sentry/node - without channel injection 138.13 kB +0.02% +23 B 🔺
@sentry/aws-serverless 106.08 kB +0.03% +23 B 🔺
@sentry/cloudflare (withSentry) - minified 204.45 kB - -
@sentry/cloudflare (withSentry) 508.11 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 229.45 kB +1.47% +3.32 kB 🔺

View base workflow run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sentry-warden[bot]
sentry-warden Bot reviewed Oct 15, 2026
View reviewed changes
Comment thread packages/nextjs/src/config/types.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@logaretm

logaretm commented Oct 15, 2026

Copy link
Copy Markdown
Member Author

bugbot run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Oct 15, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread dev-packages/e2e-tests/test-applications/nextjs-16-tunnel/tests/tunnel-dsn-path.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@logaretm
logaretm force-pushed the awad/tunnel-nextjs branch from 0bd8edd to a0d5655 Compare October 16, 2026 01:51
@logaretm

logaretm commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

bugbot run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Oct 16, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/nextjs/src/config/withSentryConfig/tunnel.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread dev-packages/e2e-tests/test-applications/nextjs-pages-dir/tests/tunnel-dsn-path.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@logaretm
logaretm force-pushed the awad/tunnel-nextjs branch from a0d5655 to bff33ce Compare October 16, 2026 02:25
@logaretm

logaretm commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

bugbot run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Oct 16, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/nextjs/src/config/withSentryConfig/tunnel.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/nextjs/src/common/sentryTunnelRouteHandler.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/nextjs/src/common/utils/dropMiddlewareTunnelRequests.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread dev-packages/e2e-tests/test-applications/nextjs-16-tunnel/tests/tunnel-dsn-path.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@logaretm
logaretm force-pushed the awad/tunnel-nextjs branch from bff33ce to 61392db Compare October 16, 2026 03:32
@logaretm

logaretm commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

bugbot run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@logaretm
logaretm force-pushed the awad/tunnel-nextjs branch from 5472088 to ae51678 Compare October 16, 2026 04:23
cursor[bot]
cursor Bot reviewed Oct 16, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/nextjs/src/config/withSentryConfig/tunnel.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@logaretm
logaretm force-pushed the awad/tunnel-nextjs branch from ae51678 to 9c50125 Compare October 16, 2026 04:48
@logaretm
logaretm force-pushed the awad/tunnel-nextjs branch from 9c50125 to e94f25d Compare October 16, 2026 14:00
@logaretm
logaretm force-pushed the awad/tunnel-nextjs branch from e94f25d to efc9b07 Compare October 16, 2026 14:37
@logaretm
logaretm force-pushed the awad/tunnel-nextjs branch from efc9b07 to 2e8e2b3 Compare October 16, 2026 16:15
@logaretm logaretm mentioned this pull request Oct 16, 2026
Next.js managed tunnel on the tunnel route handler #25466
Closed
@logaretm
logaretm force-pushed the awad/tunnel-nextjs branch from 2e8e2b3 to 2c6c3d8 Compare October 16, 2026 17:56
@logaretm
logaretm force-pushed the awad/tunnel-nextjs branch from 5bc562c to ef27f39 Compare October 28, 2026 17:57
@github-actions

github-actions Bot commented Oct 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Optional E2E tests

Some optional checks were not successful. They do not block the merge. 4 not successful, 53 successful. See the run.

Check Status
❌ CI: Optional E2E Tests / E2E node-eve Test (optional) Failing after 2m Details
❌ CI: Optional E2E Tests / E2E nextjs-16-cacheComponents (cloudflare) Test (optional) Failing after 10m Details
❌ CI: Optional E2E Tests / E2E node-eve (orchestrion) Test (optional) Failing after 2m Details
❌ CI: Optional E2E Tests / E2E node-eve (latest) Test (optional) Failing after 52s Details
Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable Test (optional) Successful in 51s Details
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries Test (optional) Successful in 49s Details
✅ CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) Successful in 39s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E deno (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-14 (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) Successful in 36s Details
✅ CI: Optional E2E Tests / E2E cloudflare-mastra Test (optional) Successful in 49s Details
✅ CI: Optional E2E Tests / E2E cloudflare-agent Test (optional) Successful in 44s Details
✅ CI: Optional E2E Tests / E2E cloudflare-flue-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable (latest) Test (optional) Successful in 46s Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (tunnel-dev) Test (optional) Successful in 57s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (deno) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) Successful in 59s Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions Test (optional) Successful in 28s Details
✅ CI: Optional E2E Tests / E2E astro-7-static Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-think Test (optional) Successful in 57s Details
✅ CI: Optional E2E Tests / E2E node-mastra Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (latest) Test (optional) Successful in 49s Details
✅ CI: Optional E2E Tests / E2E node-mastra (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (latest) Test (optional) Successful in 41s Details
✅ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-orpc Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-flue Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 (tracer provider) Test (optional) Successful in 47s Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) Successful in 28s Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions (latest) Test (optional) Successful in 29s Details
✅ CI: Optional E2E Tests / E2E node-pi-durable (latest) Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) Successful in 34s Details
✅ CI: Optional E2E Tests / E2E supabase-nextjs Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) Successful in 31s Details
✅ CI: Optional E2E Tests / E2E react-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 32s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 37s Details
✅ CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-cloudflare Test (optional) Successful in 27s Details
✅ CI: Optional E2E Tests / E2E vue-3 (no Options API) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-think (ai v6) Test (optional) Successful in 57s Details
✅ CI: Optional E2E Tests / E2E node-pi-durable Test (optional) Successful in 42s Details
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 54s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 34s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 39s Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 Test (optional) Successful in 32s Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry-static Test (optional) Successful in 1m Details
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

One or more gzipped bundles increased by more than 500 bytes. If this increase is intentional, add the Accept Bundlesize Increase label to this PR to rerun and accept the check.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@logaretm logaretm mentioned this pull request Nov 2, 2026
feat: Answer managed tunnel requests in the runtimes instead of the framework hooks #25917
Closed
logaretm added 11 commits November 6, 2026 17:46
@logaretm
ref(nextjs): Forward tunnel route requests with core's `handleTunnelR…
6be9e8c
…equest`

The tunnel route handler now leaves DSN normalization, the allowlist and
tracing suppression to core. As in every other SDK, `allowedDsns` adds to
the server's own DSN, and the default `POST` accepts the DSNs
`serveTunnelIntegration` allows.
@logaretm
feat(nextjs): Serve the browser's managed tunnel under the app's `bas…
a070356
…ePath`

`tunnel: true` in the browser now sends to `<basePath>/<hash>`, like the
SvelteKit and React Router SDKs do with their base paths. A `basePath` the
user set and a `tunnel` URL stay as written.
@logaretm
feat(nextjs): Serve the managed tunnel under the app's basePath on …
2e193f6
…the server

`withSentryConfig` now injects `basePath` into production server and edge
builds, not only in dev, and the server, edge and Cloudflare inits pass it
to `setManagedTunnelDefaults`. `serveTunnelIntegration` then matches
`/<basePath>/<hash>`, like the browser sends.
@logaretm
test(nextjs): Cover the managed tunnel under a base path
5270706
@logaretm
feat(nextjs): Serve the managed tunnel on Vercel
a7bf47a
Vercel serves unknown paths from its CDN without running the app, so the runtime never sees managed tunnel
requests there. On Vercel builds without `tunnelRoute`, `withSentryConfig` writes the tunnel route handler and
rewrites envelope requests to the DSN-derived paths there. The handler answers only when `serveTunnelIntegration`
is set up, and on a cold start too. Pages Router apps get an `app` directory with only this route.
@logaretm
feat(nextjs): Deprecate tunnelRoute
aa79eeb
`tunnel: true` in the browser and `serveTunnelIntegration` on the server serve the tunnel on every Next.js
deployment, so `tunnelRoute` and the `@sentry/nextjs/tunnel` route handlers are deprecated. `withSentryConfig`
warns when `tunnelRoute` is set.
@logaretm
ref(nextjs): Use the renamed tunnel defaults
10e5651
@logaretm
ref(nextjs): Use the renamed browser tunnel defaults
8fb222e
@logaretm
ref(nextjs): Generate the Vercel tunnel route with the public POST ha…
0c9528e
…ndler
@logaretm
fix(nextjs): Skip the Vercel tunnel route when a page has its path
a74485e
@logaretm
fix(nextjs): Post to the managed tunnel with Next's trailing slash
dce8636
With `trailingSlash: true` Next redirected the browser's POST to the tunnel path without the slash.
cursor[bot]
cursor Bot reviewed Nov 10, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/nextjs/src/config/withSentryConfig/tunnel.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/nextjs/src/config/withSentryConfig/getFinalConfigObjectUtils.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

s1gr1d
s1gr1d reviewed Nov 11, 2026
View reviewed changes
Comment thread packages/nextjs/src/config/withSentryConfig/getFinalConfigObjectUtils.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/nextjs/src/config/withSentryConfig/getFinalConfigObjectUtils.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/nextjs/src/config/withSentryConfig/tunnel.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/nextjs/src/config/withSentryConfig/tunnel.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

logaretm added 3 commits November 11, 2026 11:24
@logaretm
fix(nextjs): Write the Vercel tunnel route only in Vercel production …
9ce025b
…and preview builds
@logaretm
feat(nextjs): Serve tunnelRoute with the managed tunnel
ebeb874
The deprecated `tunnelRoute` now turns on the managed tunnel, like `tunnel: true` with `serveTunnelIntegration()`:
a string is its fixed path, `true` the path derived from the DSN. The proxy rewrite to sentry.io, which forwarded
every header including cookies, and the handler mode rewrite are gone. On Vercel, the generated route also serves the
fixed path.
@logaretm
ref(nextjs): Un-deprecate the tunnel route handler POST
8e364d0
The route `withSentryConfig` generates on Vercel re-exports it, so it stays.
cursor[bot]
cursor Bot reviewed Nov 11, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/nextjs/src/common/utils/dropMiddlewareTunnelRequests.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@logaretm
feat(nextjs): Rewrite envelope requests on any unrouted path to the V…
e1db9b1
…ercel tunnel route

A fixed tunnel `path` set in `Sentry.init` now reaches the route on Vercel too, without `tunnelRoute`. The
envelope content type keeps other requests out, and the handler forwards only envelopes for allowed DSNs.
cursor[bot]
cursor Bot reviewed Nov 11, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/nextjs/src/config/withSentryConfig/tunnel.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

logaretm added 2 commits November 11, 2026 12:16
@logaretm
fix(nextjs): Send a fixed tunnelRoute path with the envelope conten…
a888c60
…t type

The browser sends `application/x-sentry-envelope` only for a managed tunnel given as `true` or options. A fixed path
injected as a string went out as `text/plain`, which the Vercel rewrite doesn't match.
@logaretm
fix(nextjs): Drop the Next.js spans of tunnel requests on the paths d…
a128721
…erived from the DSN

The Next.js span filters only knew a fixed `tunnelRoute` path, and the `url.path` filters of the managed tunnel don't
match Next.js request spans, which carry only `http.target` at start. A proxy that runs outside of the server, like on
Vercel, sent its spans of tunnel requests. The filters now come from the paths the client serves.
s1gr1d
s1gr1d approved these changes Nov 11, 2026
View reviewed changes
cursor[bot]
cursor Bot reviewed Nov 11, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a128721. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/nextjs/src/common/utils/dropMiddlewareTunnelRequests.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/nextjs/test/edgeSdk.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@logaretm
ref(nextjs): Match tunnel request spans against the client that start…
cb3d517
…ed them
@sentry-release-bot sentry-release-bot Bot mentioned this pull request Nov 16, 2026
publish: getsentry/[email protected] getsentry/publish#10451
Closed
51 tasks done
@diobriggs diobriggs mentioned this pull request Nov 21, 2026
Avoid unused route handler imports in generated validators vercel/next.js#100045
Draft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@semgrep-code-getsentry semgrep-code-getsentry[bot] semgrep-code-getsentry[bot] left review comments
@cursor cursor[bot] cursor[bot] left review comments
@sentry-warden sentry-warden[bot] sentry-warden[bot] left review comments
@s1gr1d s1gr1d s1gr1d approved these changes
@chargome chargome Awaiting requested review from chargome chargome was automatically assigned from getsentry/team-javascript-sdks-framework
@nicohrubec nicohrubec Awaiting requested review from nicohrubec nicohrubec was automatically assigned from getsentry/team-javascript-sdks-framework

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@logaretm @s1gr1d
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.