My Ionic app was working fine and I haven't done anything to it but suddenly I am getting this error and I don't know why.
"Error: Uncaught (in promise): removeView was not found
My Ionic app was working fine and I haven't done anything to it but suddenly I am getting this error and I don't know why.
"Error: Uncaught (in promise): removeView was not found
Deleting a component is not a solution to any problem.
Cause of issue: There are multiple calls to dismiss method of loading component.
Solution: While creating the loader, check if the loader instance is not already present, only then create another instance.
Similarly, while dismissing the loader, check if the loader instance does exists, only then dismiss it.
Code:
Here is my simplest solution to this problem:
I have got this problems when implementing the LoadingController
Note: Don't initialize loader inside the construction (it works only first time and from second time you will get stuck with remove view not found problem)
I was displaying the loader while getting data from server Below is the working code
Hope it will solve SO problems
For me, the problem was that I had
when I created the loadingCtrl.
The .dismiss() was being called too soon after the .present() (during local testing the api responds really fast) and it seems having that parameter caused the issue. Removing it solved it for me.