-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expected Runtime Error due to invalid expression in a template is not displayed/lost #11827
Comments
Can you upgrade your app to Ionic 3.3.0 and test it again? And also don't forget to post your ionic info output |
Life-cycle events errors are catched by the nav controller and are not propagated, and as such, every error that initiates from the lifecycle event might be "lost". |
Upgrading to 3.3.0 seems to fix this however i did not see any reports for this problem or fixes. So I'm not really sure if this is fixed and won't appear in other, similar scenarios. P.S. I lost about an hour to fix a typo in one of my templates since the error was silently suppressed :( |
@AmitMY Why is this considered to be a life-cycle event error? The error is in the template |
It is considered to be a lifecycle event (I think) because it initiated from the nav controller, so when the error stack trace should present, it would say:
And in this point, the So it is not a life-cycle error per say, but because it initiates from the life cycle event, it is handled as such. Short discussion on "why" - #10974 |
@AmitMY Thank you very much for the detailed explanation. Another question - why do I get the runtime error as expected when the invalid expression is moved outside of *ngFor and the list is still populated inside the life cycle event? But not getting this when the invalid expression is inside *ngFor loop? I assume, based on your details above, I should not be getting this runtime error as long as the list is populated inside ionViewDidLoad or ionViewDidEnter. But this is not the case, it gets suppressed only when inside *ngFor loop. Thanks again |
Hmm.. I am not totally sure, as I will need an example to verify, but if you mean like having However, having it in Glad to help |
@jgw96 can be closed |
Thanks for handling this @AmitMY 😃 |
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. |
Ionic version: (check one with "x")
[ ] 1.x (For Ionic 1.x issues, please use https://github.com/driftyco/ionic-v1)
[ ] 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:
No error message on UI or in console however the app is broken and not functional
Expected behavior:
Should get Runtime Error
Uncaught (in promise): TypeError: Cannot read property 'test' of undefined
Steps to reproduce:
ionic start Ionic2FirstApp blank --v2
package.json
to have ionic version 3.1.0 (as described here https://github.com/driftyco/ionic/releases/tag/v3.1.0). See attached file package.json.txthome.html
andhome.ts
files located in src/pages/home to be as in the attached fileshome.ts.txt
home.html.txt
Note that in home.html template there is invalid expression {{ test.test }}
Note that after the app is transpiled and rendered there is neither error displayed not error messages in the console. If you either:
Note that the problem occurs ONLY when the list is initialized in ionViewDidLoad or ionViewDidEnter and the invalid expression is inside *ngFor loop
Related code:
Other information:
Ionic info: (run
ionic info
from a terminal/cmd prompt and paste output below):Your system information:
Cordova CLI: 7.0.1
Ionic Framework Version: 3.1.0
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 1.3.4
ios-deploy version: 1.9.1
ios-sim version: 5.0.13
OS: macOS Sierra
Node Version: v6.9.2
Xcode version: Xcode 8.3.2 Build version 8E2002
The text was updated successfully, but these errors were encountered: