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•5mo 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-sapphireOP•5mo 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-sapphireOP•5mo ago
No errors! Builds fine ..

adverse-sapphireOP•5mo ago
Managed to fix it, Was missing:
declare module "@tanstack/react-router" {
interface Register {
router: ReturnType<typeof createRouter>;
}
}
Got deleted somehow, thanks!