Skip to content

fix(nextjs): Disable managed tunnel interception on Vercel - #27019

Merged
nicohrubec merged 2 commits into
developfrom
feat/nextjs-vercel-tunnel-interception
Dec 1, 2026
Merged

nicohrubec merged 2 commits into
developfrom
feat/nextjs-vercel-tunnel-interception

Conversation

@nicohrubec

@nicohrubec nicohrubec commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

What

Disable early tunnel interception by default for Next.js on Vercel deployments, letting the generated Next.js route handle tunnel requests.

Why

The early hook prevents the application handler from running, so Vercel cannot detect when to end the function invocation. This is a minimal fix for Next.js. I suspect that this might be a broader issue with other frameworks also affected by this if deployed to Vercel? The issue is that we cannot blanket disable this option for all frameworks if deployed to Vercel, since there are frameworks that rely on this hook and do not set up a tunnel handler iiuc.

Closes: #26991

nicohrubec and others added 2 commits December 1, 2026 14:57
Co-Authored-By: GPT-6 <codex@openai.com>
Co-Authored-By: GPT-6 <codex@openai.com>
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Optional E2E tests

All optional checks were successful. 7 successful. See the run.

Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-14-supabase Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E vinext-cf-workers (workers cache) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) Successful in 2m Details

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: 5a924d3 (PR test merge using develop at 14e110f)

Against: 14e110f (develop) · base run #68441

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

Path Size % Change Change
@sentry/browser 30.58 kB - -
@sentry/browser - with treeshaking flags 28.76 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.63 kB - -
@sentry/browser (incl. Tracing) 53.72 kB - -
@sentry/browser (incl. Tracing Core) 40.65 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 53.72 kB - -
@sentry/browser (incl. Tracing, Profiling) 56.6 kB - -
@sentry/browser (incl. Tracing, Replay) 93.64 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 82.43 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 98.49 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 111.45 kB - -
@sentry/browser (incl. Feedback) 48.43 kB - -
@sentry/browser (incl. sendFeedback) 31.15 kB - -
@sentry/browser (incl. FeedbackAsync) 36.2 kB - -
@sentry/browser (incl. Metrics) 31.9 kB - -
@sentry/browser (incl. Logs) 32.18 kB - -
@sentry/browser (incl. Metrics & Logs) 32.84 kB - -
@sentry/react 32.6 kB - -
@sentry/react (incl. Tracing) 56.45 kB - -
@sentry/vue 38.78 kB - -
@sentry/vue (incl. Tracing) 56.74 kB - -
@sentry/svelte 30.61 kB - -
@sentry/effect (client) 42.27 kB - -
@sentry/effect (client, incl. Tracing) 55.01 kB - -
@sentry/effect (client, incl. Tracing, Logs, Metrics) 66.34 kB - -
@sentry/remix (Remix 3 client bundle) 59.46 kB - -
CDN Bundle 32.4 kB - -
CDN Bundle (incl. Tracing) 54.09 kB - -
CDN Bundle (incl. Logs, Metrics) 35.16 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 56.55 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 76.12 kB - -
CDN Bundle (incl. Tracing, Replay) 91.88 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 94.41 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 97.35 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 99.82 kB - -
CDN Bundle - uncompressed 94.64 kB - -
CDN Bundle (incl. Tracing) - uncompressed 159.96 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 102.98 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 167.59 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 233.37 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 280.39 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 288.02 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 292.33 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 299.95 kB - -
@sentry/nextjs (client) 60.27 kB - -
@sentry/sveltekit (client) 55.07 kB - -
@sentry/astro (client) - rolldown, without tracing 39.51 kB -0.01% -1 B 🔽
@sentry/core/server 45.91 kB - -
@sentry/core/browser 14.49 kB - -
@sentry/node 157.98 kB - -
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.6 kB - -
@sentry/node - without tracing 89.99 kB - -
@sentry/node - without channel injection 146.94 kB +0.01% +2 B 🔺
@sentry/aws-serverless 100.65 kB +0.01% +3 B 🔺
@sentry/cloudflare (withSentry) - minified 212.5 kB - -
@sentry/cloudflare (withSentry) 492.68 kB - -
@sentry/cloudflare (withSentry, instrumented CommonJS package) - minified 215.45 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 237.93 kB - -

View base workflow run

@nicohrubec
nicohrubec marked this pull request as ready for review December 1, 2026 14:06
@andreiborza
andreiborza requested a review from chargome December 1, 2026 14:07

@chargome chargome left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM but let's wait for @logaretm

@logaretm logaretm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, but didn't this #26665 fix it?

Generally we don't need the interception at all in Vercel deployments, since we have the static route handling it.

@nicohrubec

Copy link
Copy Markdown
Member Author

@logaretm seems to me that only fixed it for the tunnelRoute path

@logaretm

logaretm commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Right, I forgot about that, if youR fix addresses both then revert the changes in that other PR.

@nicohrubec

Copy link
Copy Markdown
Member Author

@logaretm old changes are still needed as long as tunnelRoute exists

@logaretm

logaretm commented Dec 1, 2026

Copy link
Copy Markdown
Member

Then all good!

@nicohrubec
nicohrubec merged commit 98bb8a9 into develop Dec 1, 2026
125 checks passed
@nicohrubec
nicohrubec deleted the feat/nextjs-vercel-tunnel-interception branch December 1, 2026 14:27
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.

[nextjs] serveTunnelIntegration still keeps Vercel invocations open until timeout (#26665 only covers tunnelRoute)

3 participants