Tons of "any" types.
Not even sure how to ask this question. I'm a web dev with ~1 year of experience trying to set up a monorepo and I'm not getting any type data out of the @tanstack/react-router package.
I've basically copied the Monorepo with React Query https://tanstack.com/router/latest/docs/framework/react/examples/router-monorepo-react-query example verbatim. My vite.config.ts, tsconfig, package.json, src/* directory, it's all completely identical.
For some reason, though, nothing coming out of the
@tanstack/react-router
package is correctly typed. It's all "any". The import is referencing the correct node module, and other packages are all correctly typed (the QueryClient
import works fine, but that comes from the react query package).
Other tools I've built in this monorepo are typed correct. I have trpc, drizzle, and auth packages that have no issues.
I'll endure any amount of shaming to just figure out wtf is going on. Sorry if this is super obvious, I'm working on a pretty insane project for work and I just need to figure this out.React TanStack Router Router Monorepo React Query Example | TanStac...
An example showing how to implement Router Monorepo React Query in React using TanStack Router.
4 Replies
complex-teal•2mo ago
1. if you’re using file based routing, did you add the router plugin to your vite config
2. is your dev server running ? i.e. is the route tree generated ?
3. reload your ide / editor
correct-apricotOP•2mo ago
Update, found this issue: https://github.com/TanStack/router/issues/4560 and rolled my version back to 1.121.21 and everything works fine now.
GitHub
Search/Param types missing in router functions · Issue #4560 · Ta...
Which project does this relate to? Router Describe the bug I find it hard to believe that this is localized to me, since I can pin point the exact commit that broke this, but alas, it happens both ...
complex-teal•2mo ago
oh
correct-apricotOP•2mo ago
Ty for the suggestions though, appreciate the help!