router.push not functioning as it should #69521
Unanswered
Tcox-int
asked this question in
App Router
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a weird one. I am using router.push() to navigate after a form submit and in 99% of the places on my site it is working flawlessly. But there are a couple pages that just are not functioning as they should. If I look at the server and the network tab I can see that the push action is going through and that the next.js server is actively going out and making calls like it would be had I gone to the page
fetching https://<website>/api/v1/admin/tags with method GET fetching https://<website>/api/v1/admin/vanillaRoles with method GET fetching https://<website>/api/v1/admin/vanillaBadges with method GETand I can see the call in my network tab
http://localhost:3000/tag-management?_rsc=52ghyBut the page never swaps over to the page in the browser. I
Now, the router.push is at the end of a react-hook-form submit after it gets the results. I think this has something to do with it, but I'm using the same pattern in other submits without issue.
If I add a button onto the page just to test it by itself, it actually DOES change pages, so I am even more confused.
Anyone have any ideas? I've tried adding router.refresh, router.prefetch and other variations of all the above with no luck.
Beta Was this translation helpful? Give feedback.
All reactions