You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(vue-router): back button blocked by a guard makes the next navigation show the wrong page #31716
Thanks for all your work on Ionic, we really enjoy building with it!
We ran into a small but tricky routing issue in @ionic/vue-router and wanted to share what we found.
What happens
If a user taps IonBackButton and a route guard stops that navigation (for example an "unsaved changes, stay on this page?" check), the next navigation goes a bit wrong: the URL updates correctly, but the outlet still shows the page the blocked back navigation wanted to go to.
How to reproduce
Go from /home to /form.
On /form, tap the back button. A guard (onBeforeRouteLeave(() => false)) keeps you on the page.
Now navigate forward with router.replace('/done').
In createIonRouter, handleNavigateBack stores incomingRouteParams for the previous page and then calls router.back(). When a guard aborts that navigation, afterEach returns early and those params stay around. The next successful navigation picks them up and renders the old page.
A possible fix
Clearing the pending params when a navigation fails as aborted or duplicated fixed it for us (the patch is in the repro under patches/). We left cancelled navigations alone, since the navigation that replaced them may already have set its own params. It's about 15 lines, and we're happy to open a PR if that helps.
Thanks for the detailed writeup and the patch! This is the same bug as the guard issue in #29721, which we fixed in #31364 and shipped in 9.0.3. v8 is in maintenance mode now, so it only gets security fixes and we won't be backporting this one. The dates are in our support policy.
Upgrading @ionic/vue and @ionic/vue-router to 9.0.3 or later should fix it for you. Heads up that v9 needs vue-router 5, so you'll have to bump that too. We have a migration tool that may help you with your move, too! I'm going to close this, but if you still see it on v9 let us know and we'll reopen.
Activity
ShaneK commentedon Nov 9, 2026
Thanks for the detailed writeup and the patch! This is the same bug as the guard issue in #29721, which we fixed in #31364 and shipped in
9.0.3. v8 is in maintenance mode now, so it only gets security fixes and we won't be backporting this one. The dates are in our support policy.Upgrading
@ionic/vueand@ionic/vue-routerto9.0.3or later should fix it for you. Heads up that v9 needsvue-router5, so you'll have to bump that too. We have a migration tool that may help you with your move, too! I'm going to close this, but if you still see it on v9 let us know and we'll reopen.