-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add timeout + abort to Link prefetching to prevent unclickable Links #25330
Comments
Not sure if this is related enough to this issue, but: Maybe the request code could also have a |
Hi! I'm closing this as a stale issue as in the meantime Gatsby 4 and related packages were released. You can check our Framework Version Support Page to see which versions currently receive active support. If this is a feature request, please create a discussion as we moved feature requests from issues to GitHub Discussions. Please try the mentioned issue on the latest version (using the Thanks! |
I haven't seen this for a while, so probably fine that it's closed. |
Description
If the background prefetch request triggered by hovering
<Link />
elements does not complete, subsequent clicks on the link appear to be broken.Eg. Hovering over a link on a page that has not yet been prefetched (or is stale) leads to a prefetch requests to
/page-data/app-data.json
(due to the call toloader.loadPage()
incache-dir/navigation.js
->navigate()
).Steps to reproduce
/page-data/app-data.json
. This can be done with eg. an Express server route in front of Gatsby that never returns a response.Expected result
The links should go to the
href
location when they are clicked on.Suggested solution
event.preventDefault()
call - navigation to thehref
should workI would also suggest considering a general timeout for all other prefetches. Maybe built into a
fetch
wrapper.Actual result
The links appear to be broken when clicked on (more keywords: non functional, not working)
Environment
Related issue
Links not working after period of inactivity: #4779
My comment on the issue: #4779 (comment)
The text was updated successfully, but these errors were encountered: