Skip to content

fix(sveltekit): Resolve Handle type on SvelteKit 3 - #25925

Closed
lazerg wants to merge 2 commits into
getsentry:developfrom
lazerg:fix/sveltekit-3-handle-type
Closed

lazerg wants to merge 2 commits into
getsentry:developfrom
lazerg:fix/sveltekit-3-handle-type

Conversation

@lazerg

@lazerg lazerg commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Why: On SvelteKit 3, Handle and ResolveOptions live in @sveltejs/kit/hooks and are no longer exported from @sveltejs/kit, so our declarations import nothing and sentryHandle() / initCloudflareSentryHandle() come out typed as any. Neither import path works on both majors, so I derive Handle from sequence, which @sveltejs/kit/hooks exports with the same signature on Kit 2 and 3.

How to review: server-common/handle.ts has the derived types; the other two files only switch their import. I checked the built .d.ts against Kit 3.1.1 and 2.70.3 in a scratch project: on Kit 3 the return types were any before and are Handle now, Kit 2 is unchanged. No unit test, since the repo builds against Kit 2 and it only shows up on Kit 3.

Closes #25924

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the external PR from an external contributor label Oct 30, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Lms24

Lms24 commented Oct 30, 2026

Copy link
Copy Markdown
Member

@lazerg please stop making contributions without asking before! Familiarize yourself with our contribution guidelines. As you've seen we had to close most of your previous PRs. We will have to ban you if this continues.

@lazerg

lazerg commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Understood.

@lazerg lazerg closed this Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external PR from an external contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@sentry/sveltekit: Handle and ResolveOptions types are any under SvelteKit 3 (imported from @sveltejs/kit instead of @sveltejs/kit/hooks)

2 participants