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•2y ago
can you please try to find out which version exactly introduced this bug?
ambitious-aquaOP•2y 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•2y ago
so 1.16.2 still works?
ambitious-aquaOP•2y 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•2y ago
@Tanner Linsley was the removal of the
invalidate functionality intentional?
https://github.com/TanStack/router/commit/8c6de040c10b2d35002b518697bdcc33d9de1d3b#diff-2ac234f610fa0e0c2146252c10a5266af9c5b6d0b63659a0fa4c9f2c4472596aL1476fascinating-indigo•2y ago
if no, I will revert this part
fascinating-indigo•2y ago
fair-rose•2y ago
No not at all. Probably an auto fix artifact of eslint.
fascinating-indigo•2y 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-aquaOP•2y ago
Thanks 🙏
fair-rose•2y 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