Repository navigation
Closed
Labels
Description
On 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
localFetchproxy ofpackages/nuxt/src/runtime/plugins/sentry-cloudflare.server.ts, the request passed towrapRequestHandlergets its body only ifisServedTunnelRequest({ method, url })matches. - That check runs before
wrapRequestHandlercreates the per-request client. No client is current at that point, sogetServedTunnel()returns nothing and the check is alwaysfalse. handleServedTunnelRequest()inwrapRequestHandlerWithInitskips 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/qpo967got401 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/qpo967for each tunnel POST. The tunnel then answered200and forwarded the envelope to the DSN host. - With the body passed on every request,
tunnel-request-body.test.tsfails: the JSON body of a non-tunnelPOST /api/post-errorshows up asrequest.dataon its error event. So the body can't just be passed for all requests. - The deleted
nuxt-4-cloudflaretunnel test didn't catch this. Built fromdevelop, its tunnel POST got200 text/htmlfromapp.vueand forwarded nothing.
Reproduction
- In fix(nuxt): Fix db0 and Cloudflare span data, run nuxt-4 on Bun, Deno and Cloudflare #26285, the optional variant
nuxt-4 (tunnel-basepath-cloudflare)reproduces it. Its two managed-tunnel tests fail withExpected: 200, Received: 401. Once this is fixed, that variant should move to the required variants.
via Isaac Schlueter.
--
Activity
linear-code commentedon Nov 13, 2026
JS-4102
isaacs commentedon Nov 13, 2026
Comment thread that spawned this: #26285 (comment)
fix(nuxt): Answer managed tunnel requests on Cloudflare
fix(nuxt): Fix db0 and Cloudflare span data, run nuxt-4 on Bun, Deno …
fix(nuxt): Answer managed tunnel requests on Cloudflare
fix(nuxt): Answer managed tunnel requests on Cloudflare (#26365)
github-actions commentedon 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.