ionic-framework: Runtime Error Uncaught (in promise): false on Ionic 2.1.0

Ionic version: (check one with “x”) [ ] 1.x [X] 2.x

I’m submitting a … (check one with “x”) [X] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:

I’m getting this problem too with ionic 2.1.0. It only happens with the device (so when plugins are working). It only happens with push or pop of NavCtrl; it will never happen with Loading or Alert because i’ve already added a .catch() to all of them. From the original stacktrack it seems to happen inside the transistion code.

Reference:

Expected behavior:

At least a way to track wich is the code causing the error without referencing polyfill.js

Steps to reproduce: Sorry, its very hard to reproduce. It only happens when doing testing on real devices. Using livereload increase the chance of getting it.

Other information:

stack trace:

"Error: Uncaught (in promise): false
02-27 22:28:06.047 32263 32263 I chromium:     at s (/build/polyfills.js:3:4211)
02-27 22:28:06.047 32263 32263 I chromium:     at s /build/polyfills.js:3:4034)
02-27 22:28:06.047 32263 32263 I chromium:     at /build/polyfills.js:3:4574
02-27 22:28:06.047 32263 32263 I chromium:     at t.invokeTask /build/polyfills.js:3:9723)
02-27 22:28:06.047 32263 32263 I chromium:     at Object.onInvokeTask (/build/main.js:42519:37)
02-27 22:28:06.047 32263 32263 I chromium:     at t.invokeTask (/build/polyfills.js:3:9659)
02-27 22:28:06.047 32263 32263 I chromium:     at e.runTask (/build/polyfills.js:3:7083)
02-27 22:28:06.047 32263 32263 I chromium:     at i (/build/polyfills.js:3:3671)", source: /__ion-dev-server/ion-dev.js?v=1.1.4 (156)

ionic info:

Cordova CLI: 6.5.0 
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.8
Node Version: v6.10.0
Xcode version: Not installed

package.json:

"dependencies": {
    "@angular/common": "2.2.1",
    "@angular/compiler": "2.2.1",
    "@angular/compiler-cli": "2.2.1",
    "@angular/core": "2.2.1",
    "@angular/forms": "2.2.1",
    "@angular/http": "2.2.1",
    "@angular/platform-browser": "2.2.1",
    "@angular/platform-browser-dynamic": "2.2.1",
    "@angular/platform-server": "2.2.1",
    "@ionic/storage": "1.1.7",
    "ionic-angular": "2.1.0",
    "ionic-native": "2.5.1",
    "ionicons": "3.0.0",
    "rxjs": "5.0.0-beta.12",
    "sw-toolbox": "3.4.0",
    "zone.js": "0.6.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.1.4",
    "typescript": "2.0.9"
  }

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 6
  • Comments: 19 (2 by maintainers)

Most upvoted comments

was working on Ionic 2.3.0. Appeared again on 3.0.0-beta.3 doing dismiss() on Loading object

also getting this error

@chandanch

dismiss should be inside the Promise like that:

loading.present().then(() => {
  //do some work
  loading.dismiss();
});

Im using Ionic 3.0.1 and facing same issue. Here is my code where Im handling all the errors properly in a catch block. Still dont know why it is throwing the error.

  // sing-in with email + pass
  loginUser() {
    this._authSrv.signInWithEmail(this._loginForm.value.email, this._loginForm.value.password)
      .then( (user) => {
        // Go to Homepage, loading will be dismissed automatically since 
        // dismissOnPageChange( )is set to true
        this._navCtrl.setRoot(HomePage);
      })
      .catch( (error) => {
        this.dismissLoading();
        this.showAlertToUser(error);
      });

    // Show loading
    this.displayLoading(); 
  }

  // Display loading ctrl
  displayLoading() {
    // create it first
    this._loading = this._loadingCtrl.create({
      dismissOnPageChange: true,
    });

    // then display
    this._loading.present()
      .catch ( (error) => {
        this.showAlertToUser(error);
      })    
  }

  // Dismiss loading ctrl
  dismissLoading() {
    this._loading.dismiss()
      .catch ( (error) => {
        this.showAlertToUser(error);
      })
  }

The case is that the 3.0.0 bundle is way faster than 2.x, and some components are being dismissed faster than they actually arrive in the controllers. We slightly refactored our LoadingControllers, that we started always dismissing them inside promises of present. Before dismiss was called before present finished. I guess its similar situation for other cases in this issue.

Please do look into this…getting same error…

further debugging shows it is related to ionic.storage - which the OP also has installed, but I am using 1.1.6

Cordova CLI: 6.4.0 Ionic Framework Version: 2.1.0 Ionic CLI Version: 2.2.1 Ionic App Lib Version: 2.2.0 Ionic App Scripts Version: 1.0.0 ios-deploy version: 1.9.0 ios-sim version: 3.1.1 OS: macOS Sierra Node Version: v7.2.1 Xcode version: Xcode 8.2 Build version 8C38