Skip to content

fix: type hooks.server exports with --tsgo-experimental-api - #3154

Open
xyrolle wants to merge 2 commits into
sveltejs:masterfrom
xyrolle:fix/tsgo-api-server-hooks
Open

xyrolle wants to merge 2 commits into
sveltejs:masterfrom
xyrolle:fix/tsgo-api-server-hooks

Conversation

@xyrolle

@xyrolle xyrolle commented Oct 22, 2026 •

Copy link
Copy Markdown

Fixes #3152

The Kit file settings the --tsgo-experimental-api provider uses to recognize hooks files had serverHooksPath: 'src/hooks.client', so src/hooks.server.ts was never typed. An untyped handle reported implicit any for event and resolve in that mode only.

Test: test-success gets a src/hooks.server.ts with an untyped handle, plus a small @sveltejs/kit module declaration for the type the hook is typed with. Without the fix, "clean project --tsgo-experimental-api" reports the two implicit-any errors. Root pnpm test passes.

@changeset-bot

changeset-bot Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a97ce8f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
svelte-language-server Patch
svelte-check Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

--tsgo-experimental-api: exports of src/hooks.server.ts aren't auto-typed

1 participant