-
Notifications
You must be signed in to change notification settings - Fork 407
Cordova pause event error from a null target #323
Comments
@juliemr could you look at this? |
This is the easy fix: #327 But I haven't found the magical combination of steps necessary to reproduce the bug outside of cordova. @adamdbradley do you have a script to create a targetless event that I can add to our tests without setting up cordova on our CI? This also doesn't address Zones possibly not properly including or wrapping Cordova's custom events - it just makes sure that it won't outright fail. |
@juliemr I dug through cordova and it looks like the Next, it passes the created Which is cordova's Channel.prototype.fire The fireArgs variable from within
One of them being the callback created from within zone's Sorry I'm not able to provide an explanation as to why cordova is calling these events like this, but hopefully this can help document where the issues are coming from, and to help create tests. Hope that helps, thanks. |
Note that this should be fixed (with my dumb fix) in the current version, but I'm leaving this open since we still don't actually have a test to guard against it failing. |
The error still occurs in iOS simulator for
How about making it like this? (I have tried this code locally and there's no error for the
I'm using Ionic 2 beta, this error can be reproduced in all Ionic 2 beta projects.
However, I didn't observe such error with the HelloWorld project created by Cordova followed by this article - http://cordova.apache.org/docs/en/latest/guide/cli/index.html. So I am not sure where the root cause of the problem locates. |
Cordova fires a
pause
event when the app is put into the background, but this error is thrown from withinpatchViaCapturingAllTheEvents()
:It looks as though
event.target
isnull
:This only happens on Cordova's
pause
event, but is not a problem with the others:https://cordova.apache.org/docs/en/latest/cordova/events/events.html#pause
The text was updated successfully, but these errors were encountered: