T
TanStack2y ago
ambitious-aqua

Router.invalidate() stopped working after update [solved in 1.16.6]

Hello! I have a strange bug, which I couldn't resolve yet. For some reasons router.invalidate() stopped working after the last update. (I updated from 1.16.0 to 1.16.5) Any idea how to fix this? Thank you very much for your help!
11 Replies
fascinating-indigo
fascinating-indigo2y ago
can you please try to find out which version exactly introduced this bug?
ambitious-aqua
ambitious-aquaOP2y ago
@Manuel Schiller Somewhere between 1.16.2 and 1.16.5. (There are no 1.16.3 and 1.16.4 in the registry, so I couldn't try these.)
fascinating-indigo
fascinating-indigo2y ago
so 1.16.2 still works?
ambitious-aqua
ambitious-aquaOP2y ago
Yes! As far as I can tell, there is nothing happening when calling invalidate(). I put some comments in different locations, nothing changes. Even the RouteComponents didn’t reload. I can confirm, the same bug exists in the Kitchen-Sink example. (Try to create a invoice at Dashboard/Invoices) @Manuel Schiller https://github.com/TanStack/router/blob/b5e85add20af6cb43929051b26e1f916bf69d9bf/packages/react-router/src/router.ts#L1455 The invalidate function is empty... Commit by Tanner: https://github.com/TanStack/router/commit/8c6de040c10b2d35002b518697bdcc33d9de1d3b
fascinating-indigo
fascinating-indigo2y ago
if no, I will revert this part
fair-rose
fair-rose2y ago
No not at all. Probably an auto fix artifact of eslint.
fascinating-indigo
fascinating-indigo2y ago
GitHub
Release v1.16.6 · TanStack/router
Version 1.16.6 - 2/18/2024, 1:10 PM Changes Fix revert removal of router.invalidate functionality (#1195) (a819b46) by Manuel Schiller Chore use createLazyFileRoute instead of lazyRouteComponent...
ambitious-aqua
ambitious-aquaOP2y ago
Thanks 🙏
fair-rose
fair-rose2y ago
Sorry! I really need to disable the auto fix for removing code after returns. But I think it’s a TS thing. I’ll hit save on some unclosed brackets and poof

Did you find this page helpful?