<Link/> sometime stop working with app router in production #57565
-
I am till learning nextjs. If I hover over the links I can see the expected page in the bottom left of my browser but clicking doesn't navigate to the page and the url doesn't change too. After a refresh or wait a short period of time , the links usually start working again but it definitely a huge hit to usability for the average user. Has anyone experienced a similar issue/ have any insight as to what might be causing this to occur? Any help is greatly appreciated :) |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments 10 replies
-
Hey @hiiamwin, Could please attach some video or a reproducing steps with the piece of code that would be helpful. Apart from that, if you are using To identify this-
Here is a good news for you - Yesterday Next 14 has been launched with a game changing feature Partial Prerendering (Preview) that should help in this. Hope it help. Happy Coding! |
Beta Was this translation helpful? Give feedback.
-
It's due to the caching. You can check the this for details. Or you can watch this video to understand it better There are several work-arounds, so you can try them by searching for your needs. What we have done was trying not to use Link as it is caching the request. |
Beta Was this translation helpful? Give feedback.
-
i try to set prefetch to false and it work |
Beta Was this translation helpful? Give feedback.
-
In my case nothing helped, after clicking |
Beta Was this translation helpful? Give feedback.
-
I have the same issue... Here's my scenario: <Link href="/dashboard">Dashboard</Link> inside server component. Dashboard calls server action, that server action calls Sometimes after page refresh it randomly stops working, hangs... I'm investigating this issue... Perhaps server actions are bugged for initial data fetches? export default async function DashboardPage() {
const myPages = await getMyPages(); // server action which calls my API using fetch
return <>....</>
``` |
Beta Was this translation helpful? Give feedback.
-
I just had the same issue, I'm using Next.js version 14.1.3, all my Link components stopped navigating suddenly, after investigating the console, I found a useEffect dependency that caused infinite loop, fixing that fixed the Link issues, so I suggest you to look closely what other code you recently changed, or any console messages and fixing them. |
Beta Was this translation helpful? Give feedback.
-
I have the same problem. It's a terrible situation for Next that this problem hasn't been solved yet. I have the same problem in the dev environment. |
Beta Was this translation helpful? Give feedback.
-
I encountered the same navigation issue, which proved to be quite challenging to debug. In my case, the problem occurred specifically when:
This sequence would cause the router to completely break, but only in Firefox and only with a production build - it worked as expected in WebKit/Blink-based browsers. The root cause ended up being that I used an |
Beta Was this translation helpful? Give feedback.
-
@hiiamwin Can you re-open this issue? It still not working in Next v14 and v15 |
Beta Was this translation helpful? Give feedback.
-
Issue is back in newer versions. Fix this ASAP Edit: Setting |
Beta Was this translation helpful? Give feedback.
i try to set prefetch to false and it work