Next.js Discord

Discord Forum

Redirect to external instead of pre-fetch after clicking an external link

Answered
Muscovy Duck posted this in #help-forum
Open in Discord
Avatar
Muscovy DuckOP
I have a peculiar bug with NextJS 13.4.12 with the next/link component.

* In production (npm run build && npm run start)
* I have a <Link /> that is pointing to an external link
* If I click this link and come back to previous URL, if I scroll down the page, I get automatically redirected to the previous external link that I click
* I have the impression that this is due to prefetching of the Link component that redirects me instead of prefecthing

Any idea on what might cause this issue?
Answered by risky
firstly, can you try updating to latest version... (13.4.19 is the latest)
View full answer

5 Replies

Avatar
risky
firstly, can you try updating to latest version... (13.4.19 is the latest)
Answer
Avatar
Muscovy DuckOP
Oh right will try right away
Avatar
Muscovy DuckOP
Noice, seems to be doing the trick ✨
Any idea if this was a known bug?
Avatar
risky
well it is a lot of versions, so it could be (but i dont know)
Avatar
Muscovy DuckOP
Thx!