Skip to content

fix(sveltekit): Support browser tracing with SvelteKit 3#22264

Draft
Lms24 wants to merge 1 commit into
developfrom
feat/sveltekit-3-compat-investigation
Draft

fix(sveltekit): Support browser tracing with SvelteKit 3#22264
Lms24 wants to merge 1 commit into
developfrom
feat/sveltekit-3-compat-investigation

Conversation

@Lms24

@Lms24 Lms24 commented Jul 14, 2026

Copy link
Copy Markdown
Member

⚠️ This is mostly unreviewed slop. Used it as a base to try some approaches. Let's not merge this before a careful review or close it in favour of a better approach.

Support SvelteKit 3 browser tracing without changing existing SDK setup. The integration selects $app/stores for SvelteKit 2 and $app/state for SvelteKit 3, using rune-based navigation observation for the latter. A preview E2E app verifies client startup, pageload tracing, and navigation tracing while existing SvelteKit 2 coverage guards compatibility.

Breaking changes: None. The public API and configuration remain unchanged; the peer range is only widened to accept SvelteKit 3.

Fixes #22263

Select the compatible tracing state API at runtime so existing setups
continue to work across SvelteKit 2 and 3. Add preview coverage for
pageload and navigation tracing without the removed $app/stores module.

Fixes #22263
Co-Authored-By: Cursor <cursoragent@cursor.com>

Co-authored-by: Cursor <cursoragent@cursor.com>
chargome added a commit that referenced this pull request Jul 15, 2026
SvelteKit 3.0.0-next.8 promoted native tracing config out of `experimental`
(`kit.experimental.tracing` -> `kit.tracing`) and dropped the
`experimental.instrumentation` flag, which broke the app build. Migrate the
Vite config to the new API.

Client-side capture is also broken on next.8 because the SDK's browser
integration imports `$app/stores`, which now throws at runtime (removed in
favour of `$app/state`), so the app never hydrates. Skip the client-side
tests until SvelteKit 3 browser support lands (#22264); server-side tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@chargome chargome self-assigned this Jul 15, 2026
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.

$app/storeswill be deprecated in SvelteKit 3 (crashing already in prerelease)

2 participants