-
Notifications
You must be signed in to change notification settings - Fork 1.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
[🐞] Prefetching not working for Link component on mouseover #7219
Comments
https://github.com/user-attachments/assets/11187723-c7e2-4def-b623-603d000d41c2 |
The Link component was updated a while ago to mimic behavior of Next.js. The prefetch happens on mouseover only during dev, while in production (or preview) it occurs when the Link becomes visible. Two things happening here:
You can verify the actual prefetch behavior is working in this video, using your same website: |
I should clarify that Qwik does a great job putting bundles together on its own, and that almost all the bundles on your example are prefetched in my video above. When you actually click a Link to another page, it loads nearly instantly with maybe only 1 extra bundle fetched for something. What I meant by point # 2 is that there can be a few edge cases usually with complex pages where things are not so straight forward and that is where altering the bundling with things like Qwik Insights can solve those issues. |
Thank you for your efforts I see the modules are fetched instantly but i also see those request were served from SW. Suggestion : Can;t we use manifest bundle to prefetch the modules on hover. I tried making a component for such and got the bundle files array ready too eg ['q-sdajh.js','q-adsfx.js',...] but when i dispatch qprefetch with these bundles it do nothing, i dont see any js being fetched in network tab. If any of the case work then i think it should be ok for me. |
Which component is affected?
Qwik City (routing)
Describe the bug
What im expecting,
When we hover on any anchor tag which nagivates to a new page it should fetch all the neccessary js files to render that page instantenously, but here when u visit the site first time (or empty cache and hard reload)
and hover any link eg Page A and wait 2 sec expecting it to prefetch the client side js and then click it then starts fetching the chunks which takes 1-3sec in some case.
In below video when i clear cache and hard reset and click page A it takes some time to navigate and display content of page A.
qwik-prefetch.mp4
Reproduction
https://github.com/rdlogout/qwik-test.git
Steps to reproduce
npm install
npm preview or npm run deploy to deploy to your own cloudflare pages and verify
System Info
Additional Information
No response
The text was updated successfully, but these errors were encountered: