Page is not loading when using router.push() properly. #58940
Replies: 7 comments 18 replies
-
try |
Beta Was this translation helpful? Give feedback.
-
When you try to navigate from the client side to a route generated server side, you might run into some problems. You can try the following approach:
Essentially, you wrap your route around a SSR component and have it redirect instead. You then trigger the redirect on the client side by calling router.refresh() |
Beta Was this translation helpful? Give feedback.
-
Faced same behaviour of router. Fixed by |
Beta Was this translation helpful? Give feedback.
-
@nirvikpurkait Did you ever figure out what the issue was? I'm facing this issue right now. |
Beta Was this translation helpful? Give feedback.
-
I'm using Next.js 15, and router.push() is working fine in development but not in production after the user logs in. What could be the possible reasons, and how can I fix this...?? |
Beta Was this translation helpful? Give feedback.
-
If it's for sign in and you are using next auth then add redirect:false |
Beta Was this translation helpful? Give feedback.
-
I'm having this issue today ( I worked around it by avoiding adding a timestamp to the search params to avoid caching issues.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I am trying to implement a log-in route, where a
form
should be there, when a user log-in, (if the user provides valid information) the user should be redirected to the root route. I'm implementing it withreact-hook-form
for validation purpose, so, to submit the form I have to useonSubmit
insted ofaction
attribute.Additional information
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions