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.

[4.0.0-beta.5] Cannot close modal 'overlay does not exist'

See original GitHub issue

After updating to Ionic 4.0.0-beta.5, I get the following error when calling dismiss() on a ModalController when I click on a button:

console.js:35 Error: Uncaught (in promise): overlay does not exist
    at resolvePromise (zone.js:814)
    at resolvePromise (zone.js:771)
    at zone.js:873
    at 

Closing the modal through the backdrop works normally.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:16
  • Comments:21 (6 by maintainers)

github_iconTop GitHub Comments

6reactions
pyboostedcommented, Aug 28, 2018

@bleuscyther if we pass 1 as the last argument, it works only for the first dismissing. We can write something like:

this.modalController.dismiss(null, undefined, null);

it would work. But still looks like bug.

3reactions
doendercommented, Aug 28, 2018

@woodstream Indeed, I have found the same in the case of modal overlays.

This works (within the component launched as a modal):

constructor(private ctrl: ModalController) {}

public async close() {
   const modal = await this.ctrl.getTop();
   modal.dismiss();
 }

but this doesn’t:

constructor(private ctrl: ModalController) {}

public close() {
   this.ctrl.dismiss();
 }

whereas the latter used to work in the previous version.

I am now using this method as a workaround.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Uncaught (in promise): overlay does not exist (ionic ...
Scenario: showing loader in ionic modal. Loader needs to be shown before getting data and dismiss it after receiving data. When I debugged...
Read more >
Dismiss a LoadingController - Ionic Framework
Hi, I switched to Ionic v4 recently and I have some troubles with LoadingController. I do not succeed to cancel it (when I...
Read more >
Modal · Bootstrap v5.2
Modals are built with HTML, CSS, and JavaScript. · Clicking on the modal “backdrop” will automatically close the modal. · Bootstrap only supports...
Read more >
body-scroll-lock - npm
... 4.0.0-beta.0, last published: 2 years ago. Start using body-scroll-lock in your project by running `npm i body-scroll-lock`. There are ...
Read more >
Changelog - Cypress Documentation
The previously experimental Cypress command, cy.origin() , is now generally available in end-to-end testing. This command allows testing multiple origins in a ...
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