T
TanStack9mo ago
extended-salmon

type error in the router.tsx

Hi. Anyone had experienced this and were able to fix?
No description
12 Replies
harsh-harlequin
harsh-harlequin9mo ago
what does the type error say?
stormy-gold
stormy-gold9mo ago
I believe I also have this. Posting so I remember replying later
harsh-harlequin
harsh-harlequin9mo ago
I saw this when you did not have the correct router context defined via createRootRouteWithContext it must have a queryClient
extended-salmon
extended-salmonOP9mo ago
I will check if it is related to createRootRouteWithContext. Thanks!
stormy-gold
stormy-gold9mo ago
TS error:
Argument of type 'Router<RootRoute<undefined, {}, AnyContext, AnyContext, {}, undefined, RootRouteChildren, FileRouteTypes>, ... 4 more ..., Record<...>>' is not assignable to parameter of type 'never'.
Argument of type 'Router<RootRoute<undefined, {}, AnyContext, AnyContext, {}, undefined, RootRouteChildren, FileRouteTypes>, ... 4 more ..., Record<...>>' is not assignable to parameter of type 'never'.
No description
harsh-harlequin
harsh-harlequin9mo ago
please show your root route
stormy-gold
stormy-gold9mo ago
Ahh, I see. I was not using createRootRouteWithContext()
harsh-harlequin
harsh-harlequin9mo ago
can you please create a GitHub issue so that this will give a better error message? maybe we need a lint rule? or just some custom TS error that is attached at the end of the error you posted above
stormy-gold
stormy-gold9mo ago
Is this Router or Start?
harsh-harlequin
harsh-harlequin9mo ago
start or rather a start "addon" TBH it does not really matter in that issue...
stormy-gold
stormy-gold9mo ago
GitHub
Unclear TypeScript error when `routerWithQueryClient(router, queryC...
Which project does this relate to? Router Describe the bug Using routerWithQueryClient(router, queryClient) without using createRootRouteWithContext() in __root.tsx leads to an unclear TypeScript e...
extended-salmon
extended-salmonOP9mo ago
Thanks for posting this. Yes, this is what I get.

Did you find this page helpful?