Repository navigation
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
Follow-up to #26659, which #26665 fixed for tunnelRoute only.
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
11.19.0 (code paths below unchanged in 11.21.0)
Framework Version
Next 16.4, deployed on Vercel, Node.js runtime
Link to Sentry event
No response (the events arrive; the problem is the Vercel function lifecycle)
Reproduction Example/SDK Setup
The setup the tunnelRoute deprecation notice recommends:
// next.config.ts: withSentryConfig without tunnelRoute
export default withSentryConfig(nextConfig, { /* ... */ })// sentry.server.config.ts
import * as Sentry from '@sentry/nextjs'
Sentry.init({
dsn: process.env.SENTRY_DSN,
integrations: [Sentry.serveTunnelIntegration({ path: '/report' })],
})// instrumentation-client.ts
import * as Sentry from '@sentry/nextjs'
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
tunnel: '/report',
})Steps to Reproduce
- Deploy the setup above to Vercel (production build, so
withSentryConfigwritesapp/sentry-tunnel/route.jsand its envelope rewrite). - Load pages so the browser SDK posts envelopes to
/report. - Check the deployment's function duration and runtime logs for the tunnel requests.
Expected Result
The invocation ends once the tunnel has answered, as it does with tunnelRoute since 11.16.0.
Actual Result
The same behavior as #26659: the browser gets its answer, the envelope reaches Sentry, and the invocation stays open until the function's maximum duration. Moving from tunnelRoute to serveTunnelIntegration on 11.19.0 multiplied our Vercel function duration from the day it deployed. Setting intercept: false is the workaround, as in #26659.
Additional Context
#26665 put the Vercel check in the Next.js server init, around the hook that tunnelRoute installs:
// @sentry/nextjs 11.21.0, build/cjs/server/index.js
const isServedByVercelTunnelRoute = !!process.env.VERCEL && process.env.VERCEL_ENV !== "development";
if (tunnelRoute && !isServedByVercelTunnelRoute) instrumentTunnelServers();serveTunnelIntegration installs the same hooks from its own setupOnce, with no such check:
// @sentry/server-utils 11.21.0, build/cjs/index.js, makeServeTunnelIntegration
setupOnce() {
if (options.intercept !== false) {
instrumentTunnelServers();
instrumentRuntimeServers?.();
}
}So the deprecation notice on tunnelRoute leads Vercel users from the fixed path back to the bug:
@deprecated Set
tunnel: truein the browserSentry.initand addserveTunnelIntegration()to the serverSentry.initinstead. The server answers the tunnel requests, also on Vercel.
#26193 plans to drop tunnelRoute in v12, which would leave serveTunnelIntegration as the only way to set up the tunnel.
Suggestion: apply the same check when serveTunnelIntegration runs under the Next.js server SDK on a Vercel deployment, for example by defaulting intercept to false there, since the generated route serves the tunnel.
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
- StatusShow more project fieldsNo status
Activity
linear-code commentedon Nov 30, 2026
JS-4188
nicohrubec commentedon Dec 1, 2026
Hey, thanks for writing in. I have a targeted fix up for nextjs, but still need to verify if this is a broader issue for other frameworks as well, so we are still discussing. We'll keep you posted.
fix(nextjs): Disable managed tunnel interception on Vercel (#27019)
nicohrubec commentedon Dec 1, 2026
Nevermind, fix just landed. We'll get this out with the next release.
itsUndefined commentedon Dec 1, 2026
Yeah I am not sure what other frameworks exist unfortunately but this increased our billed compute ten-fold after following the upgrade guide:
nicohrubec commentedon Dec 1, 2026
Yeah, sorry about that. We'll release the fix tomorrow.
github-actions commentedon Dec 1, 2026
A PR closing this issue has just been released 🚀
This issue was referenced by PR #27019, which was included in the 11.22.0 release.