-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Which project does this relate to?
Start
Describe the bug
If both head and beforeLoad have parameters, the beforeLoad returns type never:
Type '({}: BeforeLoadContextOptions<Register, any, undefined, {}, {}, AnyContext, unknown, undefined>) => {}' is not assignable to type '((ctx: BeforeLoadContextOptions<Register, any, undefined, {}, {}, AnyContext, unknown, undefined>) => never) | ((ctx: BeforeLoadContextOptions<Register, ... 6 more ..., undefined>) => never) | undefined'.
Type '({}: BeforeLoadContextOptions<Register, any, undefined, {}, {}, AnyContext, unknown, undefined>) => {}' is not assignable to type '(ctx: BeforeLoadContextOptions<Register, any, undefined, {}, {}, AnyContext, unknown, undefined>) => never'.
Type '{}' is not assignable to type 'never'.(2322)
This only seems to happen when using TanStack Start and not with TanStack Router.
Your Example Website or App
https://stackblitz.com/edit/github-bp351gyj?file=src%2Froutes%2F__root.tsx&view=editor
Steps to Reproduce the Bug or Issue
- Install packages
- Run
npm run typecheck
Expected behavior
As a developer, I don't expect to have any type-errors
Screenshots or Videos
No response
Platform
- Router / Start Version: 1.145.10
- OS: macOS
- Bundler: vite
- Bundler Version: 7.1.7
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels