-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix(link): Prefetch redirects to error pages. Fixes #5474 #5817
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
Conversation
👷 Deploy request for qwik-insights pending review.Visit the deploys page to approve it
|
@@ -48,7 +48,10 @@ export const Link = component$<LinkProps>((props) => { | |||
prefetchSymbols(url.pathname); | |||
|
|||
if (elm.hasAttribute('data-prefetch')) { | |||
loadClientData(url, elm, { prefetchSymbols: false }); | |||
loadClientData(url, elm, { | |||
prefetchSymbols: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little bit confused about prefetchSymbols
being false
!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this specifically to fetch the data separately? The symbols are being fetched elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this specifically to fetch the data separately?
I don't know really. Currently the prefetch only data. and symbols are prefetched via the service-worker
maybe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it's done two lines above this call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@builder.io/qwik](https://qwik.builder.io/) ([source](https://togithub.com/BuilderIO/qwik/tree/HEAD/packages/qwik)) | [`1.4.3` -> `1.4.4`](https://renovatebot.com/diffs/npm/@builder.io%2fqwik/1.4.3/1.4.4) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>BuilderIO/qwik (@​builder.io/qwik)</summary> ### [`v1.4.4`](https://togithub.com/BuilderIO/qwik/releases/tag/v1.4.4) [Compare Source](https://togithub.com/BuilderIO/qwik/compare/v1.4.3...v1.4.4) #### What's Changed - feat(vite): make linting op-out by [@​wmertens](https://togithub.com/wmertens) in [https://github.com/BuilderIO/qwik/pull/5801](https://togithub.com/BuilderIO/qwik/pull/5801) - fix(core): assign refs without reactivity during SSR by [@​wmertens](https://togithub.com/wmertens) in [https://github.com/BuilderIO/qwik/pull/5802](https://togithub.com/BuilderIO/qwik/pull/5802) - fix(docs): correct minor typos by [@​kylerush](https://togithub.com/kylerush) in [https://github.com/BuilderIO/qwik/pull/5804](https://togithub.com/BuilderIO/qwik/pull/5804) - chore(starters): update 🐼 PandaCSS integration starter dev dependency by [@​mrhoodz](https://togithub.com/mrhoodz) in [https://github.com/BuilderIO/qwik/pull/5806](https://togithub.com/BuilderIO/qwik/pull/5806) - fix(scoped styles): [@​container](https://togithub.com/container) block by [@​wmertens](https://togithub.com/wmertens) in [https://github.com/BuilderIO/qwik/pull/5813](https://togithub.com/BuilderIO/qwik/pull/5813) - chore: ci e2e: single worker and longer timeout by [@​wmertens](https://togithub.com/wmertens) in [https://github.com/BuilderIO/qwik/pull/5814](https://togithub.com/BuilderIO/qwik/pull/5814) - fix(link): Prefetch redirects to error pages. Fixes [#​5474](https://togithub.com/BuilderIO/qwik/issues/5474) by [@​iamriajul](https://togithub.com/iamriajul) in [https://github.com/BuilderIO/qwik/pull/5817](https://togithub.com/BuilderIO/qwik/pull/5817) - chore: publish qwik-react with types by [@​wmertens](https://togithub.com/wmertens) in [https://github.com/BuilderIO/qwik/pull/5819](https://togithub.com/BuilderIO/qwik/pull/5819) - fix: Fix input reactivity in `useResource$()` tutorial by [@​alexcsandru](https://togithub.com/alexcsandru) in [https://github.com/BuilderIO/qwik/pull/5818](https://togithub.com/BuilderIO/qwik/pull/5818) - docs: fix qwik-nutshell example by [@​ozanmakes](https://togithub.com/ozanmakes) in [https://github.com/BuilderIO/qwik/pull/5824](https://togithub.com/BuilderIO/qwik/pull/5824) - chore(starters): update 🐼 PandaCSS integration starter dev dependency by [@​mrhoodz](https://togithub.com/mrhoodz) in [https://github.com/BuilderIO/qwik/pull/5825](https://togithub.com/BuilderIO/qwik/pull/5825) - chore: 1.4.4 by [@​wmertens](https://togithub.com/wmertens) in [https://github.com/BuilderIO/qwik/pull/5828](https://togithub.com/BuilderIO/qwik/pull/5828) #### New Contributors - [@​kylerush](https://togithub.com/kylerush) made their first contribution in [https://github.com/BuilderIO/qwik/pull/5804](https://togithub.com/BuilderIO/qwik/pull/5804) - [@​alexcsandru](https://togithub.com/alexcsandru) made their first contribution in [https://github.com/BuilderIO/qwik/pull/5818](https://togithub.com/BuilderIO/qwik/pull/5818) - [@​ozanmakes](https://togithub.com/ozanmakes) made their first contribution in [https://github.com/BuilderIO/qwik/pull/5824](https://togithub.com/BuilderIO/qwik/pull/5824) **Full Changelog**: QwikDev/qwik@v1.4.3...v1.4.4 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 9pm on sunday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/ascorbic/unpic-img). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNzMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjE3My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
Overview
Fixes: #5474
What is it?
Description
This PR fixes the bug by adding a flag to the
loadClientData
function, and updatehandlePrefetch
in link-component to use the flag to indicate that the call is intended to just prefetch not actual navigation, So in-case the route does occur unexpected error or doesn't exist it shouldn't redirect to the page.Checklist: