You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Nuxt managed tunnel on Cloudflare drops the request body #26364
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 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.
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.
Activity
linear-code commentedon Nov 13, 2026
JS-4102
isaacs commentedon Nov 13, 2026
Comment thread that spawned this: #26285 (comment)