Skip to content

fix(nuxt): Answer managed tunnel requests on Cloudflare - #26365

Open
isaacs wants to merge 1 commit into
feat/nuxt-4-runtime-variantsfrom
isaacschlueter/js-4102-nuxt-managed-tunnel-on-cloudflare
Open

isaacs wants to merge 1 commit into
feat/nuxt-4-runtime-variantsfrom
isaacschlueter/js-4102-nuxt-managed-tunnel-on-cloudflare

Conversation

@isaacs

@isaacs isaacs commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

sentryCloudflareNitroPlugin matched the tunnel before wrapRequestHandler created the client. No client was current, so the match always failed, the tunnel request got no body, and the app answered it instead of the SDK.

The plugin now matches the tunnel inside the wrapRequestHandler callback, where the client exists, and passes the body Nitro read only to the tunnel handler. Other requests still get no body, so their bodies stay off their events.

The nuxt-4-cloudflare tunnel e2e test only checked for a 200, which the app returns too. It now waits for the forwarded envelope, and it fails without this fix.

Closes #26364

`sentryCloudflareNitroPlugin` matched the tunnel before
`wrapRequestHandler` created the client. No client was current, so the
match always failed, the tunnel request got no body, and the app
answered it instead of the SDK.

The plugin now matches the tunnel inside the `wrapRequestHandler`
callback, where the client exists, and passes the body Nitro read only
to the tunnel handler. Other requests still get no body, so their
bodies stay off their events.

The `nuxt-4-cloudflare` tunnel e2e test only checked for a 200, which
the app returns too. It now waits for the forwarded envelope, and it
fails without this fix.

Closes #26364

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@isaacs
isaacs added this pull request to stack #26366 November 13, 2026 16:15
@linear-code

linear-code Bot commented Nov 13, 2026

Copy link
Copy Markdown

JS-4102

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: 255495c (PR test merge using develop at ad4bbc3)

Against: 075093d (develop) · base run #66039

⚠️ Baseline mismatch: 9 develop commit(s) in the PR build are missing from the baseline. Their size changes also affect this comparison. Compare commits. Re-run once develop's baseline build for ad4bbc3 finishes.

Path Size % Change Change
@sentry/browser 30.1 kB - -
@sentry/browser - with treeshaking flags 28.3 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.2 kB - -
@sentry/browser (incl. Tracing) 52.28 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 52.29 kB - -
@sentry/browser (incl. Tracing, Profiling) 55.25 kB - -
@sentry/browser (incl. Tracing, Replay) 92.82 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 81.6 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 97.21 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 110.6 kB - -
@sentry/browser (incl. Feedback) 47.73 kB - -
@sentry/browser (incl. sendFeedback) 30.69 kB - -
@sentry/browser (incl. FeedbackAsync) 35.69 kB - -
@sentry/browser (incl. Metrics) 31.43 kB - -
@sentry/browser (incl. Logs) 31.71 kB - -
@sentry/browser (incl. Metrics & Logs) 32.37 kB - -
@sentry/react 32.11 kB - -
@sentry/react (incl. Tracing) 54.95 kB - -
@sentry/vue 38.3 kB - -
@sentry/vue (incl. Tracing) 55.24 kB - -
@sentry/svelte 30.12 kB - -
@sentry/remix (Remix 3 client bundle) 58.06 kB - -
CDN Bundle 31.87 kB - -
CDN Bundle (incl. Tracing) 52.7 kB - -
CDN Bundle (incl. Logs, Metrics) 34.67 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 55.26 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 75.7 kB - -
CDN Bundle (incl. Tracing, Replay) 90.72 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 93.33 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 96.09 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.69 kB - -
CDN Bundle - uncompressed 92.98 kB - -
CDN Bundle (incl. Tracing) - uncompressed 155.45 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 101.33 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 163.08 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 231.44 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 275.61 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 283.24 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 287.4 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 295.02 kB - -
@sentry/nextjs (client) 58.37 kB - -
@sentry/sveltekit (client) 53.48 kB - -
@sentry/core/server 44.65 kB - -
@sentry/core/browser 14.3 kB - -
@sentry/node 150.22 kB -0.01% -10 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.3 kB - -
@sentry/node - without tracing 88.47 kB -0.01% -8 B 🔽
@sentry/node - without channel injection 139.17 kB -0.01% -4 B 🔽
@sentry/aws-serverless 98.36 kB -0.01% -4 B 🔽
@sentry/cloudflare (withSentry) - minified 204.55 kB - -
@sentry/cloudflare (withSentry) 474.76 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 229.86 kB - -

View base workflow run

@github-actions

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 nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 44s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 37s Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (tunnel-dev) Test (optional) Successful in 58s Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (kv-cache) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 34s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-cloudflare Test (optional) Successful in 34s Details

This branch has not been deployed

No deployments
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.

Nuxt managed tunnel on Cloudflare drops the request body

1 participant