Closed lvzhenbo closed 7 months ago
Thanks for the issue! This issue has been labeled as holiday triage
. With the winter holidays quickly approaching, much of the Ionic Team will soon be taking time off. During this time, issue triaging and PR review will be delayed until the team begins to return. After this period, we will work to ensure that all new issues are properly triaged and that new PRs are reviewed. In the meantime, please read our Winter Holiday Triage Guide for information on how to ensure that your issue is triaged correctly. Thank you!
Hi there,
Can you please create a reproduction of the issue that includes only the code required to reproduce the problem?
Thanks for the issue! This issue has been labeled as needs reproduction
. This label is added to issues that need a code reproduction.
Please reproduce this issue in an Ionic starter application and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.
If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.
For a guide on how to create a good reproduction, see our Contributing Guide.
Hi there,
Can you please create a reproduction of the issue that includes only the code required to reproduce the problem?
https://github.com/lvzhenbo/ionic-vue3.4
There are two commits here, the latest commit is the incorrect case and the penultimate commit is the correct case. Then it's a matter of clicking on the selection bar to switch routes, and you'll see some one page will refresh and the other won't
I was creating the demo and realized that it may have nothing to do with the vue version update and everything to do with the @vitejs/plugin-vue version update
Hi there, Can you please create a reproduction of the issue that includes only the code required to reproduce the problem?
There are two commits here, the latest commit is the incorrect case and the penultimate commit is the correct case. Then it's a matter of clicking on the selection bar to switch routes, and you'll see some one page will refresh and the other won't
Updating from Vue 3.3.13 to Vue 3.4.4 causes the issue to appear. However, I'm still able to reproduce the issue if I remove Ionic Framework from the application. Have you tried reporting this to the Vue team?
Updating from Vue 3.3.13 to Vue 3.4.4 causes the issue to appear. However, I'm still able to reproduce the issue if I remove Ionic Framework from the application. Have you tried reporting this to the Vue team?
For vue-router this anomaly is instead normal. Related documentation: https://router.vuejs.org/guide/essentials/dynamic-matching.html#Reacting-to-Params-Changes
So I'm guessing that ionic has a workaround for this situation, which is now broken due to a vue version upgrade
Updating from Vue 3.3.13 to Vue 3.4.4 causes the issue to appear. However, I'm still able to reproduce the issue if I remove Ionic Framework from the application. Have you tried reporting this to the Vue team?
Confirmed that downgrading my project from vue 3.4 to 3.3 resolved this issue. I was not able to find a workaround so that I could stay on 3.4.
It seems vue-router's onBeforeRouteUpdate()
is firing and the to
route has the correct params... but the props are not being updated with the new parameters. I'm not sure how to coerce the props into seeing the new parameters. Seems like there should be a way...
We had a similar experience. When upgrading to vue 3.4.5 it started to reuse components when routing between two paths using same route with different params (user/1
, user/2
). Downgrading to 3.3.8 (the version we had before upgrade) solved the issue.
To me it seems like vue is following the vue-router documentation:
onBeforeRouteUpdate
to update the component is working. Interested in knowing when this will be solved. Is this a vue issue, or is this that the ionic-vue-router should be updated to conform to the new vue-router ?
Is this a vue issue, or is this that the ionic-vue-router should be updated to conform to the new vue-router ?
I'm looking into this, but I don't have a good answer at the moment other than that the expected behavior should work. My initial investigation revealed that this watch
callback is not firing anymore on route changes: https://github.com/ionic-team/ionic-framework/blob/ad65824722da0eed90ef9e595b743754bfd360b8/packages/vue/src/components/IonRouterOutlet.ts#L69-L70
Doing watch(() => [route]...
does not work, but watch(route...
does. I need to dig a bit more into why this is the case.
If you need a resolution sooner then I recommend downgrading to Vue 3.3.x for now.
It appears this new behavior is due to a breaking change in Vue: https://github.com/vuejs/core/issues/9916#issuecomment-1872602294
The commit for this has been reverted because it was a bigger breaking change than the team expected: https://github.com/vuejs/core/issues/9965#issuecomment-1875067499
It sounds like this was already released, so maybe there's something else causing an issue too.
It appears this new behavior is due to a breaking change in Vue: vuejs/core#9916 (comment)
The commit for this has been reverted because it was a bigger breaking change than the team expected: vuejs/core#9965 (comment)
It sounds like this was already released, so maybe there's something else causing an issue too.
From the changelog, is it related to this pr (https://github.com/vuejs/core/pull/5912) ?
Yeah that looks like it is related too. I'll start looking into how we can mitigate this inside of Ionic.
Can everyone try the following dev build and let me know if the issue is resolved in their apps with Vue 3.4+?
npm install @ionic/vue@7.6.6-dev.11705526292.1bc0acb5 @ionic/vue-router@7.6.6-dev.11705526292.1bc0acb5
If you're using Vite you might need to remove node_modules/.vite
before testing (this is a cache and will be re-created when you serve the app again).
https://github.com/lvzhenbo/ionic-vue3.4 Validated, jumps fine, should be solved
Can everyone try the following dev build and let me know if the issue is resolved in their apps with Vue 3.4+?
Confirmed. That dev build works with vue@3.4.14
for the routes I was experiencing the issue on.
Nice! Will this be released in the next ionic update?
Can everyone try the following dev build and let me know if the issue is resolved in their apps with Vue 3.4+?
I can confirm as well, fixed the issue for me.
Thanks for the issue. This has been resolved via https://github.com/ionic-team/ionic-framework/pull/28846, and a fix will be available in an upcoming release of Ionic Framework.
Thanks! Do you know when the release will be shipped?
The bug fix will follow our patch release schedule: https://ionicframework.com/docs/reference/versioning#release-schedule
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Prerequisites
Ionic Framework Version
v7.x
Current Behavior
The inability to jump is simply the original behavior of the vue-router
Expected Behavior
Should have jumped.
Steps to Reproduce
Update vue to 3.4, update @vitejs/plugin-vue to 5.0
Code Reproduction URL
https://github.com/lvzhenbo/tsdm-app/tree/652cd1de3281772d6bdd2642d37b73567918efbc
Ionic Info
[WARN] Error loading @capacitor/ios package.json: Error: Cannot find module '@capacitor/ios/package.json'
Ionic:
Ionic CLI : 7.2.0 Ionic Framework : @ionic/vue 7.6.2
Capacitor:
Capacitor CLI : 5.6.0 @capacitor/android : 5.6.0 @capacitor/core : 5.6.0 @capacitor/ios : not installed
Utility:
cordova-res : not installed globally native-run : not installed globally
System:
NodeJS : v20.9.0 (C:\Program Files\nodejs\node.exe) npm : 10.1.0 OS : Windows 10
Additional Information
No response