question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: IonNav is creating a new RootPage after modal dismiss

See original GitHub issue

Bug Report

Ionic version:

[ ] 4.x [x] 5.x

Current behavior:

I am using navigation inside a modal with IonNav. When I dismiss the modal, the IonNav is creating a new rootPage component.

Expected behavior:

When the modal is dismissed, IonNav should not create new component.

Steps to reproduce:

Using Ionic/Vue, create a IonNav inside a modal. You have to make a navigation action inside the modal (push) for the problem to appear.

If no navigation is made (modal dismiss without navigation), the case does not happen.

Related code:

Using the “Ionic/Vue Nav in modals” sample project from aaronksaunders, with some additional log statements https://github.com/florian72810/ionic-vue-nav-in-modals

BaseModal: created
ModalHome.vue?7215:80 ModalHome: created
ModalHomeDetail.vue?4bd5:53 ModalHomeDetail: created
ModalHome.vue?7215:68 ModalHome: modal is dismissing
ModalHome.vue?7215:80 ModalHome: created
ModalHome.vue?7215:70 ModalHome: modal dismissed

With the simple project, the problem is not blocking. But on my real project, the modal is dismissed while still rendering. This ends with an error “Cannot read property ‘__composer’ of undefined” from “vue-i18n”, and the router does not respond.

Other information:

Ionic info:

Ionic:

   Ionic CLI       : 6.12.3 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework : @ionic/vue 5.5.4

Capacitor:

   Capacitor CLI   : 2.4.6
   @capacitor/core : 2.4.6

Utility:

   cordova-res : not installed
   native-run  : 1.3.0

System:

   NodeJS : v14.15.4 (/Users/foxer/.nvm/versions/node/v14.15.4/bin/node)
   npm    : 6.14.10
   OS     : macOS Big Sur

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
florian72810commented, Apr 26, 2021

It works with the dev build 👍

1reaction
liamdebeasicommented, Apr 26, 2021

Thanks! Sorry I must have misread your original post. Can you try the following dev build and let me know if it resolves the issue?

npm install @ionic/vue@5.7.0-dev.202104261509.665b9c9 @ionic/vue-router@5.7.0-dev.202104261509.665b9c9
Read more comments on GitHub >

github_iconTop Results From Across the Web

bug: IonNav is creating a new RootPage after modal dismiss ...
Current behavior: I am using navigation inside a modal with IonNav. When I dismiss the modal, the IonNav is creating a new rootPage...
Read more >
How to Navigate in Ionic Modals with ion-nav - Ionic Blog
First of all we focus on creating a base for the modal. The purpose of this base component is to render the ion-nav...
Read more >
Navigation Controller within Modal - ionic-v3
I want to show a page called “AreaDetails”. I created an AreaDetailsWrapper Page that looks like this. import {NavParams, Page, ViewController} ...
Read more >
Ionic Modal On Dismiss Bug - Stack Overflow
Try to change your code this way async showLoginModal() { const modal = await this.modalController.create({ component: LoginModalComponent }); ...
Read more >
How to Navigate in Ionic Modals with ion-nav in VueJS
The idea here is to show how to create a navigation stack in your Ionic VueJS Application that is specifically for a modal...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found