T
TanStack5mo ago
adverse-sapphire

Route typesafety isn't working

All of a sudden I stopped getting any route type safety, I can't see anything that would cause this? Is there any documentation or files I should be checking? Just plain tanstack router
4 Replies
flat-fuchsia
flat-fuchsia5mo ago
you might try deleting the routeTree.gen.ts and regenerate it did you update anything? restart your IDE? maybe added a new route that has incorrect types somehow?
adverse-sapphire
adverse-sapphireOP5mo ago
I tried deleting the tree and reinstalled all node modules I can't recall anything I have changed that would cause this! New invalid routes just pass
adverse-sapphire
adverse-sapphireOP5mo ago
No errors! Builds fine ..
No description
adverse-sapphire
adverse-sapphireOP5mo ago
Managed to fix it, Was missing: declare module "@tanstack/react-router" { interface Register { router: ReturnType<typeof createRouter>; } } Got deleted somehow, thanks!

Did you find this page helpful?