Skip to content

feat(sveltekit): Serve the managed tunnel from sentryHandle under the app's base path - #25415

Draft
logaretm wants to merge 4 commits into
awad/tunnel-cloudflarefrom
awad/tunnel-sveltekit
Draft

logaretm wants to merge 4 commits into
awad/tunnel-cloudflarefrom
awad/tunnel-sveltekit

Conversation

@logaretm

@logaretm logaretm commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Implements sveltekit tunnel wiring, the way it works is:

  • Our Vite plugin injects the base path if it exists to both server/client bundles.
  • Our entry handler will check for any incoming request if it is a tunneled one, and if it matches it handles it.

(I made the decision to respect base paths rather than ignoring them, this is something to review in #25199)

closes #20256

@logaretm
logaretm added this pull request to stack #25201 October 15, 2026 15:33
@logaretm
logaretm force-pushed the awad/tunnel-sveltekit branch 2 times, most recently from 364f99c to b6212f2 Compare October 15, 2026 15:36
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 31.03 kB +3.87% +1.16 kB 🔺
@sentry/browser - with treeshaking flags 28.82 kB +2.87% +803 B 🔺
@sentry/browser - with treeshaking flags tracing without tracing 28.72 kB +2.86% +798 B 🔺
@sentry/browser (incl. Tracing) 53.24 kB +2.26% +1.17 kB 🔺
@sentry/browser (incl. Tracing + Span Streaming) 53.24 kB +2.24% +1.17 kB 🔺
@sentry/browser (incl. Tracing, Profiling) 56.24 kB +2.24% +1.23 kB 🔺
@sentry/browser (incl. Tracing, Replay) 92.99 kB +1.28% +1.17 kB 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 81.48 kB +1% +799 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 97.74 kB +1.24% +1.19 kB 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 110.67 kB +1.09% +1.19 kB 🔺
@sentry/browser (incl. Feedback) 48.6 kB +2.55% +1.21 kB 🔺
@sentry/browser (incl. sendFeedback) 36.12 kB +3.37% +1.18 kB 🔺
@sentry/browser (incl. FeedbackAsync) 41.25 kB +3% +1.2 kB 🔺
@sentry/browser (incl. Metrics) 32.03 kB +3.65% +1.13 kB 🔺
@sentry/browser (incl. Logs) 32.32 kB +3.65% +1.14 kB 🔺
@sentry/browser (incl. Metrics & Logs) 33.01 kB +3.78% +1.2 kB 🔺
@sentry/react 32.84 kB +3.58% +1.13 kB 🔺
@sentry/react (incl. Tracing) 55.52 kB +2.08% +1.13 kB 🔺
@sentry/vue 39.21 kB +3.09% +1.17 kB 🔺
@sentry/vue (incl. Tracing) 56.25 kB +2.26% +1.24 kB 🔺
@sentry/svelte 31.06 kB +3.88% +1.16 kB 🔺
@sentry/remix (Remix 3 client bundle) 58.28 kB +2.11% +1.2 kB 🔺
CDN Bundle 32.36 kB +2.27% +716 B 🔺
CDN Bundle (incl. Tracing) 53.3 kB +1.38% +723 B 🔺
CDN Bundle (incl. Logs, Metrics) 34.55 kB +2.13% +718 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 55.25 kB +1.34% +728 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 75.52 kB +1.01% +751 B 🔺
CDN Bundle (incl. Tracing, Replay) 90.97 kB +0.8% +717 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 92.96 kB +0.86% +785 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 97.14 kB +0.77% +737 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 99.14 kB +0.81% +792 B 🔺
CDN Bundle - uncompressed 95.04 kB +2% +1.86 kB 🔺
CDN Bundle (incl. Tracing) - uncompressed 157.88 kB +1.19% +1.85 kB 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 101.58 kB +1.87% +1.86 kB 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 163.84 kB +1.15% +1.85 kB 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 231.62 kB +0.82% +1.86 kB 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 278.05 kB +0.67% +1.85 kB 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 283.99 kB +0.66% +1.85 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 291.75 kB +0.64% +1.85 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 297.69 kB +0.63% +1.85 kB 🔺
@sentry/nextjs (client) 57.92 kB +1.98% +1.12 kB 🔺
@sentry/sveltekit (client) 53.67 kB +2.34% +1.23 kB 🔺
@sentry/core/server 41.85 kB +1.78% +730 B 🔺
@sentry/core/browser 13.81 kB - -
@sentry/node 153.84 kB +0.5% +757 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 84.04 kB - -
@sentry/node - without tracing 95.58 kB +0.75% +709 B 🔺
@sentry/node - without channel injection 131.89 kB +0.57% +747 B 🔺
@sentry/aws-serverless 103.84 kB +0.79% +804 B 🔺
@sentry/cloudflare (withSentry) - minified 212.53 kB +0.92% +1.93 kB 🔺
@sentry/cloudflare (withSentry) 526.33 kB +0.73% +3.8 kB 🔺
@sentry/nextjs/cloudflare (withSentry) - minified 230.21 kB +0.85% +1.93 kB 🔺

View base workflow run

@logaretm
logaretm force-pushed the awad/tunnel-sveltekit branch 2 times, most recently from de28310 to 47c1f76 Compare October 15, 2026 16:20
@logaretm
logaretm force-pushed the awad/tunnel-sveltekit branch from 47c1f76 to d1a7e32 Compare October 15, 2026 16:38
@logaretm
logaretm force-pushed the awad/tunnel-sveltekit branch from d1a7e32 to 17f5b0c Compare October 15, 2026 17:15
@logaretm
logaretm force-pushed the awad/tunnel-sveltekit branch from 17f5b0c to ff9f3cc Compare October 15, 2026 17:36
@logaretm
logaretm force-pushed the awad/tunnel-sveltekit branch 2 times, most recently from 7185904 to 0846a80 Compare October 15, 2026 18:16
@logaretm
logaretm force-pushed the awad/tunnel-sveltekit branch from 0846a80 to 2d31aba Compare October 15, 2026 18:26
@logaretm
logaretm force-pushed the awad/tunnel-sveltekit branch from 2d31aba to d7b1800 Compare October 15, 2026 18:28
@logaretm

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/sveltekit/test/vite/tunnelBasePath.test.ts
@logaretm
logaretm force-pushed the awad/tunnel-sveltekit branch from d7b1800 to 1d49365 Compare October 16, 2026 01:51
@logaretm

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/sveltekit/src/vite/tunnelBasePath.ts Outdated
@logaretm
logaretm force-pushed the awad/tunnel-sveltekit branch from 1d49365 to 89e93d5 Compare October 16, 2026 02:25
@logaretm

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

1 issue from previous review remains unresolved.

Fix All in Cursor

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 89e93d5. Configure here.

@logaretm
logaretm force-pushed the awad/tunnel-sveltekit branch 2 times, most recently from 008ebec to e4d5a12 Compare October 16, 2026 14:00
@logaretm
logaretm force-pushed the awad/tunnel-sveltekit branch from e4d5a12 to 56a9292 Compare October 16, 2026 14:37
@logaretm
logaretm force-pushed the awad/tunnel-sveltekit branch 2 times, most recently from 30af971 to 859fed8 Compare October 16, 2026 17:56
@logaretm
logaretm force-pushed the awad/tunnel-sveltekit branch from 859fed8 to fcac4c7 Compare October 16, 2026 20:56
…he app's base path

`sentryHandle` answers tunnel requests before isolation, tracing and routing.
`sentrySvelteKit()` hands `paths.base` to the client and server SDKs, so
`tunnel: true` works under a base path without repeating it.
@logaretm
logaretm force-pushed the awad/tunnel-sveltekit branch from fcac4c7 to ee7a133 Compare October 16, 2026 21:02

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.

SvelteKit tunnel adapter

1 participant