GeezerVison is showing github.com — Nuxt managed tunnel on Cloudflare drops the request body · Issue #26364 · getsentry/sentry-javascript
Nuxt managed tunnel on Cloudflare drops the request body #26364DescriptionOn Nuxt 4 (Nitro v2) with the cloudflare_module preset, the managed tunnel never answers. sentryCloudflareNitroPlugin drops the body of tunnel requests, so the SDK's tunnel handler ignores them and the app handles them instead. With an auth middleware, as in the nuxt-4 e2e app, the browser's tunnel requests get a 401.
Root cause
- In the
localFetch proxy of packages/nuxt/src/runtime/plugins/sentry-cloudflare.server.ts, the request passed to wrapRequestHandler gets its body only if isServedTunnelRequest({ method, url }) matches.
- That check runs before
wrapRequestHandler creates the per-request client. No client is current at that point, so getServedTunnel() returns nothing and the check is always false.
handleServedTunnelRequest() in wrapRequestHandlerWithInit skips a request without a body, so the request falls through to the app.
- The check came in with feat(cloudflare): Answer managed tunnel requests in
withSentry #25999.
Evidence (from a local wrangler dev run of the nuxt-4 e2e app, built without sentry.server.config.ts as the Cloudflare setup documents):
- Unpatched, every tunnel POST to
/app/qpo967 got 401 blocked by user auth, the first one and later ones alike.
- With a log added at that check and the body passed unconditionally, the log printed
SERVED? false /app/qpo967 for each tunnel POST. The tunnel then answered 200 and forwarded the envelope to the DSN host.
- With the body passed on every request,
tunnel-request-body.test.ts fails: the JSON body of a non-tunnel POST /api/post-error shows up as request.data on its error event. So the body can't just be passed for all requests.
- The deleted
nuxt-4-cloudflare tunnel test didn't catch this. Built from develop, its tunnel POST got 200 text/html from app.vue and forwarded nothing.
Reproduction
Related: #24838, #26285
via Isaac Schlueter.
--
View Session [Sentry]
Activitylinear-code commented on Nov 13, 2026 isaacs commented on Nov 13, 2026 added a commit that references this issue on Nov 17, 2026This issue will close once commit 0a0de1a is merged into the 'develop' branch.0a0de1a github-actions commented on Nov 17, 2026 A PR closing this issue has just been released 🚀
This issue was referenced by PR #26365, which was included in the 11.14.0 release.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|