I encountered this in an Angular 12 and Ionic 6 project:

ionic modal main.js:1 ERROR Error: Uncaught (in promise): overlay does not exist

Solution

Apparently I dismissed a modal for the second time. So beware of this.

Other possible solutions

  • The mentioned issue might appear due to inadequate usage of Ionic LoadingController, one common use case is when loader.dismiss() is executed before loader.present(),
  • ensuring that the modal to be dismissed exists, then calling dismiss.
  • Make sure you did not wrongly import the PopoverController instead of ModalController.

  •  Do not dismiss modal before it was created.

 

 

Saved you some valuable time?

Buy me a drink 🍺