Ionic version: (check one with "x")
[ ] 1.x
[ ] 2.x
[x] 3.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 think this is an old BUG, one comes back many times from a long time. I had not this error before on passing to v3 and IonicPage lazy loading.
I'm playing around pushing root pages for LoginPage/MainPage on http 401 exception.
When I got an 401 error status I will push LoginPage to rootPage. I have a two ion-navs one which loads LoginPage or MainPage and one in MainPage whichs loads any SubPages in MainPage
I have the error using ionViewCanEnter() where I call my AuthGuard which is calling resource /usser/current which is getting an 401 error
I think the main problem is the ionViewCanEnter which doesn't work very well with Promise calling a Observable
ionViewCanEnter(): Promise
return new Promise((resolve, reject) => {
this.userService.current(true).toPromise()
.then((data) => {
resolve();
})
.catch((error) => {
reject('ERROR');
});
});
}
I think it would very heart have to reproduce my error on my side on a simple ionic app.
Can someone help me figuring out the bug?
Runtime Error
Uncaught (in promise): false
Stack
Error: Uncaught (in promise): false
at g (http://localhost:8100/build/polyfills.js:3:7133)
at l (http://localhost:8100/build/polyfills.js:3:6251)
at http://localhost:8100/build/polyfills.js:3:5607
at http://localhost:8100/build/polyfills.js:3:17487
at t.invoke (http://localhost:8100/build/polyfills.js:3:14529)
at Object.onInvoke (http://localhost:8100/build/main.js:4499:37)
at t.invoke (http://localhost:8100/build/polyfills.js:3:14469)
at n.run (http://localhost:8100/build/polyfills.js:3:9741)
at http://localhost:8100/build/polyfills.js:3:6774
at t.invokeTask (http://localhost:8100/build/polyfills.js:3:15213)
at Object.onInvokeTask (http://localhost:8100/build/main.js:4490:37)
at t.invokeTask (http://localhost:8100/build/polyfills.js:3:15134)
at n.runTask (http://localhost:8100/build/polyfills.js:3:10390)
at a (http://localhost:8100/build/polyfills.js:3:5313)
at XMLHttpRequest.invoke (http://localhost:8100/build/polyfills.js:3:16210)
Ionic Framework: 3.0.1
Ionic App Scripts: 1.3.1
Angular Core: 4.0.0
Angular Compiler CLI: 4.0.0
Node: 6.10.2
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/54.0.2840.59 Safari/537.36
Expected behavior:
This should solved as soon as possibile
Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):
Cordova CLI: 6.5.0
Ionic Framework Version: 3.0.1
Ionic CLI Version: 3.0.0-beta.5
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.8
Node Version: v6.10.2
Xcode version: Not installed
Hello, thanks for using Ionic, we will look into this.
Take a look at the issue below. Some of us are also experiencing something similar using Firebase and AngularFire2
https://github.com/driftyco/ionic/issues/10046#issuecomment-293126341
@gigocabrera I already saw your issue but I'm not sure how this can help us. Why you resolved your issue using then for controller.
We are not using controllers in this behavior we already checked this
@jgw96 can we hope in a nightly for this :'(
@mburger81 sorry, I meant my comment for @jgw96 so he knows there are more people having similar issues
A okay, yeah tear are several problems on this, I really hope they can resolve this as soon as possible
I think I am facing same problem.
Ionic version: (check one with "x")
[ ] 1.x
[ ] 2.x
[x] 3.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/
Code to reproduce (The code is within a Page within a Tab)
const loading = this.loadingCtrl.create({
content: 'Fetching data...'
});
loading.present();
const data$ = Observable.of([1, 2, 3, 4]);
const data$.subscribe(res => {
loading.dismiss();
});
Then It doesn't matter in what lifecycle hook put the code that it ends up failing. I realized that if I move data fetching logic to an http request like this.http.get() then it works
Runtime Error
Uncaught (in promise): false
Stack
Error: Uncaught (in promise): false
at g (http://localhost:8100/build/polyfills.js:3:7133)
at l (http://localhost:8100/build/polyfills.js:3:6251)
at l (http://localhost:8100/build/polyfills.js:3:5937)
at http://localhost:8100/build/polyfills.js:3:6765
at t.invokeTask (http://localhost:8100/build/polyfills.js:3:15213)
at Object.onInvokeTask (http://localhost:8100/build/main.js:4489:37)
at t.invokeTask (http://localhost:8100/build/polyfills.js:3:15134)
at n.runTask (http://localhost:8100/build/polyfills.js:3:10390)
at a (http://localhost:8100/build/polyfills.js:3:5313)
I suspect this might be related to #11119.
the same error when I use a loading with @IonicPage =>
let load:Loading = this.loadCtrl.create();
load.present().then(()=>{
load.dismiss();
});
Error =>
ERROR Error: 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)
The error for me must be something under the hood because we don't use in this case no AlertController oder oder things like that. @jgw96 are there somr news for us?
News?
Im using it this way
LoadingControllerShow() {
this.loading = this.loadingCtrl.create({
spinner: 'ios',
content: 'Please wait...',
dismissOnPageChange: true,
});
this.loading.present();
}
LoadingControllerDismiss() {
this.loading.dismiss().catch(() => console.log('error on dismiss'));
}
Hope that helps
IMHO the previous comment is an antipattern. Do not store loading components as object properties; that encourages reuse bugs. Only make them lexically scoped.
Nightly for this?
need this too!
I think, on latest nightly the BUG seams to be resolved. But now there are other problems on it!
:angry:
Like this #11374
Any Solution to this Problem?
//Try send values true or false in this promise, then use the value in promise navController.push
ionViewCanEnter(): Promise {
return new Promise((resolve, reject) => {
this.userService.current(true).toPromise()
.then((data) => {
resolve(true);
})
.catch((error) => {
resolve(false);
});
});
}
ionViewCanEnter(): Promise<boolean> {
return this.store
.select(fromApp.isGameDataLoaded)
.filter(value => value === true)
.take(1)
.toPromise();
}
This issue has been automatically identified as an Ionic 3 issue. We recently moved Ionic 3 to its own repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there.
If I've made a mistake, and if this issue is still relevant to Ionic 4, please let the Ionic Framework team know!
Thank you for using Ionic!
Issue moved to: https://github.com/ionic-team/ionic-v3/issues/263