Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear TypeScript error when using routerWithQueryClient(router, queryClient) without createRootRouteWithContext() #3003

Open
leonlarsson opened this issue Dec 13, 2024 · 0 comments

Comments

@leonlarsson
Copy link

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 error in router.tsx:

Argument of type 'Router<RootRoute<undefined, {}, AnyContext, AnyContext, {}, undefined, RootRouteChildren, FileRouteTypes>, ... 4 more ..., Record<...>>' is not assignable to parameter of type 'never'.

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-csygmngw?file=app%2Frouter.tsx

Steps to Reproduce the Bug or Issue

  1. Visit StackBlitz link
  2. Go to router.tsx
  3. See TS error on line 16

Expected behavior

This is an easy thing to miss, so having an error that is easily understood would be good.

Screenshots or Videos

No response

Platform

N/A

Additional context

No response

@leonlarsson leonlarsson changed the title Unclear TypeScript error when routerWithQueryClient(router, queryClient) without createRootRouteWithContext() Unclear TypeScript error when using routerWithQueryClient(router, queryClient) without createRootRouteWithContext() Dec 13, 2024
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

No branches or pull requests

1 participant