Ionic-framework: Runtime Error Uncaught (in promise): false on Ionic 2.0.0-rc.5

Created on 16 Jan 2017  ·  66Comments  ·  Source: ionic-team/ionic-framework

Running an ionic 2 app in dev environment crashes with error:

Runtime Error
Uncaught (in promise): false
Stack
Error: Uncaught (in promise): false
at s (http://localhost:8100/build/polyfills.js:3:4211)
at s (http://localhost:8100/build/polyfills.js:3:4034)
at http://localhost:8100/build/polyfills.js:3:4574
at t.invokeTask (http://localhost:8100/build/polyfills.js:3:9723)
at Object.onInvokeTask (http://localhost:8100/build/main.js:38187:37)
at t.invokeTask (http://localhost:8100/build/polyfills.js:3:9659)
at e.runTask (http://localhost:8100/build/polyfills.js:3:7083)
at i (http://localhost:8100/build/polyfills.js:3:3671)
Ionic Framework: 2.0.0-rc.5
Ionic Native: 2.2.11
Ionic App Scripts: 1.0.0
Angular Core: 2.2.1
Angular Compiler CLI: 2.2.1
Node: 6.9.4
OS Platform: Windows 10
Navigator Platform: Win32
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36

Fresh reinstall -g ionic, fresh node_modules install.

Your system information:
ordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.5
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.9.4
Xcode version: Not installed

I had the same error with rc4 and nightly builds didn't help.
It's working without errors on rc3 and earlier

Most helpful comment

Here's the thing:
nav.push(), .pop(), viewcontroller.dismiss() and family return a promise because the transition can actually be rejected, for example by returning false in ionViewCanLeave/CanEnter.

Make sure you "catch" the promise by doing:

this.view.dismiss().catch(() => console.log('view was not dismissed'));

All 66 comments

We can't get anything just from this, you need to follow the issue template. I would recommend ionic serve to see what error you get in the browser. But yeah please share code and other information.

I got this error after closing a modal

Take a look at your modal code and make sure that nothing funky is happening on the close event.

   dismiss() {
        this.viewCtrl.dismiss();
    }

Is all I do

+1
same issue when use LoadingController or ActionSheetController

image

Look at your ondismiss method in your primary page. Usually this type of thing is a developer issue. If anything, look at the call stack in the console.

On Jan 16, 2017, 8:00 AM -0500, Beylkhanov Damir notifications@github.com, wrote:
>

+1
same issue


You are receiving this because you commented.
Reply to this email directly, view it on GitHub (https://github.com/driftyco/ionic/issues/10046#issuecomment-272856264), or mute the thread (https://github.com/notifications/unsubscribe-auth/AEPIElAzcg8Rsqpf1HzX2q1EgPhFg-6cks5rS2nngaJpZM4LkFyw).

@wbhob I just rolled back to RC4 and the issue goes away. I have a repo on GitHub if you want to use it for troubleshooting purposes. Let me know

are you using ionViewCanLeave?

@manucorporat Not sure who your question is for, but I'm not using ionViewCanLeave. I'm using ionViewDidLoad() if that helps

I'm using ionViewCanLeave and I'm getting this error, too. +1

I'm facing this error too. +1

Here's the thing:
nav.push(), .pop(), viewcontroller.dismiss() and family return a promise because the transition can actually be rejected, for example by returning false in ionViewCanLeave/CanEnter.

Make sure you "catch" the promise by doing:

this.view.dismiss().catch(() => console.log('view was not dismissed'));

When I "catch" the .dismiss() on my LoadingController, the issue goes away. So bottom line, looks like we ALWAYS have to "catch" any dismiss() in our code just to be safe. Right?

Are any of you using Firebase in your app? Possibly related to this: https://github.com/driftyco/ionic/issues/9589

Having the same issue, adding .catch() will stop the error from showing.
However, I'm also passing data in the dismiss() call. When the OnDidDismiss function is then executed, the data it receives is always undefined.

@brandyscarney Yes, I am using Firebase

In my case it was the dismiss() of LoadingController that caused the crash.
I've changed it from
this.loading.dismiss();
to
this.loading.dismiss().catch(() => console.log('ERROR CATCH: LoadingController dismiss'));

It worked in rc3 and before but was crashing in rc4 and rc5

9659 #9589

+1

Hello everyone! So just to clear things up here, you guys only get this issue when using firebase correct? Also are you guys using the firebase js sdk or AngularFire2 ?

Also, if you are using firebase could you guys tell me which firebase method it is that you are using when you get this error?

Hey people, I just wrote something about it in the other issue, take a look and let me know if it fixes it for you: https://github.com/driftyco/ionic/issues/9589#issuecomment-274121299

I am getting a couple of strange issues seemingly related to alert controllers. Both snippets below result in the same Uncaught in Promise error, and it has to do with creating a loading after dismissing the confirm.

I tried different ways of doing thing and am getting the same result, though I have another weird issue.

  1. The doDelete never gets a delete property.. even though it should.
// Show the confirmation
let confirm = this.alertCtrl.create({
      title: 'Delete category?',
      message: 'Are you sure you wish to delete this category?',
      buttons: [
        { text: 'No' },
        {
          text: 'Yes',
          handler: () => {
            confirm.dismiss({ delete: true });
          }
        }
      ]
});

// Bug in RC5?
confirm.present();
confirm.onDidDismiss((doDelete: any) => {
    if (doDelete.delete) {
        this.doDelete(category);
    }
});
  1. I originally had the doDelete function part of the confirm yes handler, and it gave the uncaught error too, I moved it out because I thought that was the cause.
handler: () => {
    confirm.dismiss().then(() => {
          let loading = this.loadingCtrl.create({
               content: 'Deleting category...'
         });
         loading.present().then(() => {

In both cases, it errors after the loading.present() is called. I am running latest cordova, ionic, and RC5 project (clean).

Thanks for the example code @davec21 ! I can now reproduce this issue and am looking into a fix for it.

@jgw96 Awesome! Glad you were able to reproduce it, I was banging my head on the desk trying to figure it out.

haha I have spent many a moment banging my head on the desk (:

Seems to be related to the dismiss() of the confirm box (AlertController). Based on a little testing, it seems like as soon as you subscribe to an observable (after dismiss is called) it throws the error.

If I don't call the dismiss() manually and let it just close then everything seems fine.

@davec21

If I don't call the dismiss() manually and let it just close then everything seems fine.

hmmm, in your case, you must to turn on dismissOnPageChange setting (e.g. for AlertController), otherwise, it not will be work as well

Same error here, but getting it with the ToastController.
Occurs when I have a toast active and change the route.
I have dismissOnPageChange: true however.

The route I am navigation to activates a loading 'thing' via the LoadingController in its ionViewDidLoad hook.

@niklas-dahl

you can try this approach which is worked for me as well

loading.dismiss().then(() => { //navigation or other staff });

P.S. set dismissOnPageChange to false

@beylkhanovdamir

hmmm, in your case, you must to turn on dismissOnPageChange setting (e.g. for AlertController), otherwise, it not will be work as well

I am not changing page though. I am simply calling dismiss on a dialog in the handler for the button. If the issue is not using that, then it should probably be named something else. Your code is effectively what I am doing (if you read my snippits).

The "handler" function MUST have a "return false".

It's important to note that the handler returns false. A feature of button handlers is that they automatically dismiss the alert when their button was clicked, however, we'll need more control regarding the transition. Because the handler returns false, then the alert does not automatically dismiss itself. Instead, you now have complete control of when the alert has finished transitioning, and the ability to wait for the alert to finish transitioning out before starting a new transition.

From: https://ionicframework.com/docs/v2/api/components/alert/AlertController/

This solved the issue to me. XD

Hi,

I am facing the same issue with LoadingController with dismissOnPageChange:true and RC6

image

If I use the dismiss() method it still fails if I don't catch() the error, but no way to make it work with dismissOnPageChange:true which is actually what I want, I don't want to dismiss manually every LoadingController.

Thanks and best regards.

I am seeing this too with ModalController. Not using Firebase (plan to).

let modal = this.modalCtrl.create(ModalSearchPage);
        modal.onDidDismiss(data => {
            console.log(data);
        });
        modal.present();

ModalSearchPage html

<form [formGroup]="todo" (ngSubmit)="handleOk($event)">
    <ion-item>
        <ion-label>Todo</ion-label>
        <ion-input type="text" formControlName="title"></ion-input>
    </ion-item>
    <ion-item>
        <ion-label>Description</ion-label>
        <ion-textarea formControlName="description"></ion-textarea>
    </ion-item>
    <button ion-button type="submit" [disabled]="!todo.valid">Ok</button>
    <button ion-button [disabled]="!todo.valid" (click)="handleCancel($event)">Cancel</button>
</form>

ModelSearchPage typescript

todo = {};
    constructor(public viewCtrl: ViewController, private formBuilder: FormBuilder) {
        this.todo = this.formBuilder.group({
            title: ['', Validators.required],
            description: [''],
        });
    }

    handleOk() {
        let data = { 'foo': 'bar' };
        this.viewCtrl.dismiss(data);
    }

    handleCancel() {
        this.viewCtrl.dismiss();
    }

So this fails but only on the cancel. Tried all the options above and it continues to fail whenever the dismiss is triggered. The onDidDismiss fires... but then we get the uncaught;

However, when I pull the cancel button out of the form, then I no longer get the error.

Hey everyone,

Thanks for all of the comments! We are no longer able to reproduce this issue using the final version 2.0.0. If you are not updated to the final version, please check the changelog for steps to update between versions: https://github.com/driftyco/ionic/blob/master/CHANGELOG.md

If you are still running into this issue, please create a new issue. Make sure to fill out the provided issue template including steps to reproduce with a repository or plunker that we can use. I'm going to close this issue because it's hard for us to differentiate between who is still running into the problem and who isn't. Thanks! :)

Same issue happening on 2.0.0. If I don't call this.loading.dismiss(); the error goes away.
And I'm not using Firebase.

ngOnInit() {
    this.bulletins = this.bulletinService.bulletins$.do(
      collection => { this.hideSpinner() },
      error => {
        this.hideSpinner()
        this._events.publish('notice', { alertCtrl: this.alertCtrl, message: "There seems to be a problem loading bulletins. Please try again later.", title: 'Error' })
      }
    )
    this.showSpinner()
  }

private showSpinner() {
    this.loading = this.loadingCtrl.create({
      spinner: 'dots',
      content: 'Loading...'
    });
    this.loading.present();
  }

  private hideSpinner() {
    if (this.loading !== undefined) {
      this.loading.dismiss();
    }
  }

Cordova CLI: 6.3.1
Ionic Framework Version: 2.0.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.8.5
ios-sim version: 5.0.6
OS: macOS Sierra
Node Version: v6.7.0
Xcode version: Xcode 8.2.1 Build version 8C1002

Hey @AdrianTeh , would you mind opening a new issue please?

Was there a new issue opened for this? I am still having the problem when using dismissOnPageChange: true in lonic 2.0.1

I still have this problem too on Modalcontroller.
I just created a new blank app, and tried to pass data from my modal back to the main view.
I nhave to add a catch block after the dismiss() block.

this.viewCtrl.dismiss(this.notiz).catch(() => {});;

@blakezeisler 2.0.1?

Yes!

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: Windows 10
Node Version: v6.9.5
Xcode version: Not installed

"ionic-angular": "2.0.1"

yes, i meant 2.0.1

I'm getting this issue on ionic 2.0.1

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.

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"
  }

Here in my project I use ionViewCanEnter() to check if the device is connected to the internet.
Of course, as the connection status is not instant returned, the query should be done asynchronously, that's why I use Promises there.
If it's not connected, the promise resolves returning the false value back to the ionViewCanEnter().

e.g.

ionViewCanEnter() {
    return whenConnected(this.networkService, this.appMessages, this.navCtrl);
}

The code above calls a function whenConnected which returns a Promise. The API documentation accepts boolean and Promise as return value on ionViewCanEnter.

That function has a code similar to this:

whenConnected() : Promise<boolean> {
    return this.deviceService.ready.then(() => {
        if(this.deviceService.connected){
            return true;
        }else{
            return false;
        }
    });
}

ATTENTION: The code above does not represent the real code to get device connection state. That real one is a bit more complicated and not useful for this example. I have just simplified it to show how am I using Promises to achieve the issue on my project.

Conclusion
With this code I get the error when the promise is resolved with the false value which should be used to tell to the navigation controller that the view CANNOT enter.

UPDATE 1: It's Ionic2 version 2.1.0.

The stack trace:

Error: Uncaught (in promise): false
    at s (polyfills.js:3)
    at polyfills.js:3
    at Object.ti.reject (nav-controller-base.js:187)
    at nav-controller-base.js:462
    at t.invoke (polyfills.js:3)
    at Object.onInvoke (ng_zone.js:236)
    at t.invoke (polyfills.js:3)
    at e.run (polyfills.js:3)
    at polyfills.js:3
    at t.invokeTask (polyfills.js:3)

Hope it helps solving this issue.
Thanks alot !

ss

i got this error (attached picture )when i execute this code bellow i am using ionic 2 and google maps plugin
import { Component } from '@angular/core';

import { NavController } from 'ionic-angular';

import {
GoogleMap,
GoogleMapsEvent,
GoogleMapsLatLng,
CameraPosition,
GoogleMapsMarkerOptions,
GoogleMapsMarker
} from 'ionic-native';

@Component({
selector: 'page-contact',
templateUrl: 'contact.html'
})

export class ContactPage {

constructor(public navCtrl: NavController) {
}

ngAfterViewInit() {
this.loadMap();
}

loadMap(){
// create a new map by passing HTMLElement
let element: HTMLElement = document.getElementById('map');
let map = new GoogleMap(element);
// create LatLng object
let ionic: GoogleMapsLatLng = new GoogleMapsLatLng(43.0741904,-89.3809802);

// create CameraPosition
let position: CameraPosition = {
target: ionic,
zoom: 18,
tilt: 30
};

// listen to MAP_READY event
map.one(GoogleMapsEvent.MAP_READY).then(() => {
// move the map's camera to position
map.moveCamera(position); // works on iOS and Android
});

// create new marker
let markerOptions: GoogleMapsMarkerOptions = {
position: ionic,
title: 'Ionic'
};

map.addMarker(markerOptions)
.then((marker: GoogleMapsMarker) => {
marker.showInfoWindow();
});

}

}

I believe this error occurs whenever a modal is accessed/opened by pushing it into the NavController array instead of using its native .present() function.

Trying to .dismiss() it would then fail because the modal was never "_presented_"...

(My newb opinion, tho'... Very new to Ionic 2 and Angular/TS.)

I facing the same issue too in 3.0.1:

let loading = loadingController.create({
  spinner : 'hide',
  content : `Loading...`
});
loading.present().then(() => {
  //do some work
});
//Do some more work
loading.dismiss();

Ionic info:

Cordova CLI: 6.5.0
Ionic Framework Version: 3.0.1
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.0
ios-deploy version: Not installed
ios-sim version: 5.0.8
OS: macOS Sierra
Node Version: v6.10.1
Xcode version: Xcode 8.2.1 Build version 8C1002

Error Message:

Uncaught (in promise): false
    at g (polyfills.js:3)
    at l (polyfills.js:3)
    at l (polyfills.js:3)
    at polyfills.js:3
    at t.invokeTask (polyfills.js:3)
    at Object.onInvokeTask (core.es5.js:4136)
    at t.invokeTask (polyfills.js:3)
    at n.runTask (polyfills.js:3)
    at a (polyfills.js:3)

This issue should be re-opened again.

Yes @chandanch @jgw96 This issue happened after i upgrade to ionic 3...

seem like LoadController problem...

I did a thorough debugging of my code and I found out that In one instance I was calling the dismiss() twice. If you call the dismiss() again for the LoadingController that is already dismissed you get this error.
In the other instance if the if the loading is dismissed even before the it is created.

@chandanch @jgw96

this is my code

**ionViewDidLoad() {

this.platform.ready()
  .then(() =>
  {
     this.books = this.angFire.database.list('/books');
     loading.dismiss();
  });
   let loading = this.loadingCtrl.create({content:'My message'});
  loading.present();
  console.log(this.angFire.database.list('/books'));

}**

i encounter error Uncaught (in promise): false after upgrade to ionic 3.0.0

after remove loadingcontroller, error gone

Seem like it have something wrong with the controller after upgrade.

Please guide me to solve this problem. I wanted to add loading before the platform ready...

@chenlitchian looks like you are dismissing the loading which is not created. Or the code is partially shared here Hence its returning you Uncaught promise exception.

this.platform.ready().then(() => {
    this.books = this.angFire.database.list('/books');
    // Here you are dismissing loading which is not created
    loading.dismiss();
});

Try doing it this way using ionViewDidLoad.

ionViewDidLoad() {
    let loader = this.loadingController.create({
      spinner : 'hide',
      content : `Loading...`
    });
    loader.present.then(() => {
      this.books = this.angFire.database.list('/books');
      loader.dismiss().then(() => {
        console.log("Loading dismissed");
      });
    })
  }

@chandanch Yes, thank you. It worked ...

I'm getting this error when I use an action sheet and dismiss it via tapping the backdrop (using version 2.0.0, but it looks like this same error occurs for various versions of the release client and up). I don't see how to add error handling to the dismiss that gets called by tapping the backdrop. Any help would be appreciated here.

@GerryFudd Can you share the code or the plunker? We can have a better picture.

I get the error, I never used any firebase :)
I push the page from menu like page with the following:

this.NavController.push(page.component);

The pushed page has

// 20170518
    ionViewWillLeave() {
        //
        // http://stackoverflow.com/questions/43175186/ionic-2-tabs-reset-view-when-clicking-another-tab
        // enable if we want to pop/reset to upon user switching view eg.tabs
        this.NavController.pop();
    }

then I switch tabs, without backing out and I get an error

core.es5.js:1084 ERROR Error: Uncaught (in promise): navigation stack needs at least one root page
    at c (polyfills.js:3)
    at Object.reject (polyfills.js:3)
    at Tab.NavControllerBase._fireError (nav-controller-base.js:322)
    at Tab.NavControllerBase._failed (nav-controller-base.js:310)
    at nav-controller-base.js:365
    at t.invoke (polyfills.js:3)
    at Object.onInvoke (core.es5.js:4125)
    at t.invoke (polyfills.js:3)
    at r.run (polyfills.js:3)
    at polyfills.js:3

ionic info

global packages:

    @ionic/cli-utils : 1.0.0
    Cordova CLI      : 7.0.0
    Ionic CLI        : 3.0.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.0.0
    @ionic/cli-plugin-ionic-angular : 1.0.0
    Ionic Framework                 : ionic-angular 3.2.0

System:

    Node       : v7.2.0
    OS         : Windows 7
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed

Thanks

Open a modal, then click back button.

ERROR Error: Uncaught (in promise): invalid views to insert
    at c (polyfills.js:3)
    at Object.reject (polyfills.js:3)
    at NavControllerBase._fireError (nav-controller-base.js:322)
    at NavControllerBase._failed (nav-controller-base.js:310)
    at nav-controller-base.js:365
    at t.invoke (polyfills.js:3)
    at Object.onInvoke (core.es5.js:4128)
    at t.invoke (polyfills.js:3)
    at r.run (polyfills.js:3)
    at polyfills.js:3
defaultErrorLogger  @   core.es5.js:1084
ErrorHandler.handleError    @   core.es5.js:1144
IonicErrorHandler.handleError   @   ionic-error-handler.js:63
next    @   core.es5.js:4757
schedulerFn @   core.es5.js:3830
SafeSubscriber.__tryOrUnsub @   Subscriber.js:238
SafeSubscriber.next @   Subscriber.js:185
Subscriber._next    @   Subscriber.js:125
Subscriber.next @   Subscriber.js:89
Subject.next    @   Subject.js:55
EventEmitter.emit   @   core.es5.js:3816
NgZone.triggerError @   core.es5.js:4188
onHandleError   @   core.es5.js:4149
t.handleError   @   polyfills.js:3
r.runGuarded    @   polyfills.js:3
(anonymous) @   polyfills.js:3
e.microtaskDrainDone    @   polyfills.js:3
o   @   polyfills.js:3
invoke  @   polyfills.js:3

__INFO__

global packages:

    @ionic/cli-utils : 1.0.0
    Ionic CLI        : 3.0.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-ionic-angular : 1.1.2
    Ionic Framework                 : ionic-angular 3.2.1

System:

    Node       : v7.10.0
    OS         : macOS Sierra
    Xcode      : Xcode 8.3.2 Build version 8E2002 
    ios-deploy : 1.8.6 
    ios-sim    : 5.0.8 

Simple solution might be adding setTimeout(() => {do action here ...}, 500);
Action can change of nav.setRoot(Component Name) or nav.push(Component Name).

This removed error for me.

all was working ok, but now i dont know what I changed i get the error with :
`this.navCtrl.push(MainPage);

Error: Uncaught (in promise): invalid views to insert
at c (http://localhost:8100/build/polyfills.js:3:13190)
at Object.reject (http://localhost:8100/build/polyfills.js:3:12546)
at NavControllerBase._fireError (http://localhost:8100/build/main.js:48745:16)
at NavControllerBase._failed (http://localhost:8100/build/main.js:48733:14)
at http://localhost:8100/build/main.js:48788:59
at t.invoke (http://localhost:8100/build/polyfills.js:3:8971)
at Object.onInvoke (http://localhost:8100/build/main.js:4657:37)
at t.invoke (http://localhost:8100/build/polyfills.js:3:8911)
at r.run (http://localhost:8100/build/polyfills.js:3:4140)
at http://localhost:8100/build/polyfills.js:3:13731

Ionic Framework: 3.5.0
Ionic App Scripts: 1.3.12
Angular Core: 4.1.3
Angular Compiler CLI: 4.1.3
Node: 8.1.0
OS Platform: Linux 4.8
Navigator Platform: Linux x86_64
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36
`

thanks if someone have an idea

@webmobiles Please delete above post and open it as a new one with more details.You're using Ionic 3.5.0.
Here: https://github.com/ionic-team/ionic/issues/new

It works!Thanks

Hi,
I facing this error.
screen shot 2018-01-23 at 17 53 40

@TwalibuMsangi - did you import the proper module? The TOH tutorial explains how to do this here: https://angular.io/tutorial/toh-pt6. They are using the newer HttpClient and you appear to be using the older Http module, but the concepts are basically the same. Only the details are different (FWIW, I suggest using the newer HttpClient if you can (not sure what version of Angular you are on).

screenshot_2018-07-15 ionic app
hey guys um I'm kinda new to this thing I was wondering if I could get help....I'm having problems passing data between pages using ngOnInIt, navParams and navController

hi, i have a problem cause i want to use a external plugin and it doesnt work and i dont know why, the name is com.lampa.startapp and this is the only think that i need to finish my app. please if some one can help me with that do it faster. here the error.
Error: Uncaught (en promesa): ReferenceError: startApp no ​​está definido ReferenceError: startApp no ​​está definido en http: // localhost: 8100 / build / main.js: 497: 27 en t.invoke (http: // localhost: 8100 /build/polyfills.js:3:14976) en Object.onInvoke (http: // localhost: 8100 / build / vendor.js: 5134: 33) en t.invoke (http: // localhost: 8100 / build / polyfills .js: 3: 14916) en r.run (http: // localhost: 8100 / build / polyfills.js: 3: 10143) en http: // localhost: 8100 / build / polyfills.js: 3: 20242 en t .invokeTask (http: // localhost: 8100 / build / polyfills.js: 3: 15660) en Object.onInvokeTask (http: // localhost: 8100 / build / vendor.js: 5125: 33) en t.invokeTask (http : // localhost: 8100 / build / polyfills.js: 3: 15581) en r.runTask (http: // localhost: 8100 / build / polyfills.js: 3: 10834) en c (http: // localhost: 8100 /build/polyfills.js:3:19752) en http: // localhost:8100 / build / polyfills.js: 3: 20273 en t.invokeTask (http: // localhost: 8100 / build / polyfills.js: 3: 15660) en Object.onInvokeTask (http: // localhost: 8100 / build / vendor .js: 5125: 33) en t.invokeTask (http: // localhost: 8100 / build / polyfills.js: 3: 15581) en r.runTask (http: // localhost: 8100 / build / polyfills.js: 3 : 10834) en o (http: // localhost: 8100 / build / polyfills.js: 3: 7894) en e.invokeTask [como invocación] (http: // localhost: 8100 / build / polyfills.js: 3: 16823 ) en p (http: // localhost: 8100 / build / polyfills.js: 2: 27648) en HTMLImageElement.v (http: // localhost: 8100 / build / polyfills.js: 2: 27893)runTask (http: // localhost: 8100 / build / polyfills.js: 3: 10834) en o (http: // localhost: 8100 / build / polyfills.js: 3: 7894) en e.invokeTask [como invocar] ( http: // localhost: 8100 / build / polyfills.js: 3: 16823) en p (http: // localhost: 8100 / build / polyfills.js: 2: 27648) en HTMLImageElement.v (http: // localhost: 8100 / build / polyfills.js: 2: 27893)runTask (http: // localhost: 8100 / build / polyfills.js: 3: 10834) en o (http: // localhost: 8100 / build / polyfills.js: 3: 7894) en e.invokeTask [como invocar] ( http: // localhost: 8100 / build / polyfills.js: 3: 16823) en p (http: // localhost: 8100 / build / polyfills.js: 2: 27648) en HTMLImageElement.v (http: // localhost: 8100 / build / polyfills.js: 2: 27893)

=> here the code

import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, Platform } from 'ionic-angular';
import {CrearPage} from '../crear/crear';
import { InAppBrowser } from '@ionic-native/in-app-browser';

declare var startApp: any;

@IonicPage()
@Component({
selector: 'page-utilidades',
templateUrl: 'utilidades.html',
})
export class UtilidadesPage {
user: string;

constructor(private iap: InAppBrowser,
public navCtrl: NavController,
public navParams: NavParams,
public platform: Platform) {
}

facebook(){
this.platform.ready().then(()=>{
var GoFaceb = startApp.set({
"action": "ACTION_VIEW",
"uri": "fb://facewebmodal/f?href=https://www.facebook.com/"
}).start();
});
}
}

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GeorgeAnanthSoosai picture GeorgeAnanthSoosai  ·  3Comments

brandyscarney picture brandyscarney  ·  3Comments

BilelKrichen picture BilelKrichen  ·  3Comments

daveshirman picture daveshirman  ·  3Comments

gio82 picture gio82  ·  3Comments