5

I have an Ionic 2 beta 7 app (also happens in Beta 6) that uses the Google Maps JavaScript API.

If I click down on the map, drag it and "throw" the map before releasing the click, it causes this error to occur on the next attempt at dragging the map.

Here is the JavaScript stack trace

TypeError: Cannot read property 'ca' of null at .r.Kj (https://maps.googleapis.com/maps-api-v3/api/js/25/7/common.js:215:70) at Object..B.trigger (https://maps.googleapis.com/maps/api/js?key=MYKEY:93:119) at dy (https://maps.googleapis.com/maps-api-v3/api/js/25/7/common.js:164:140) at . (https://maps.googleapis.com/maps-api-v3/api/js/25/7/common.js:163:441) at Object._.B.trigger (https://maps.googleapis.com/maps/api/js?key=MYKEY:93:119) at .r.dl (https://maps.googleapis.com/maps-api-v3/api/js/25/7/common.js:228:350) at Kv..r.fm (https://maps.googleapis.com/maps-api-v3/api/js/25/7/common.js:195:106) at ZoneDelegate.invokeTask (http://localhost:8100/build/js/zone.js:356:38) at Zone.runTask (http://localhost:8100/build/js/zone.js:256:48) at ZoneTask.invoke (http://localhost:8100/build/js/zone.js:423:34)

Although it doesn't seem to cause any UI issues from a users point of view it would be good to know if there is a way to prevent this from happening?

Note

Dragging the map and releasing it when the mouse is static this error doesn't occur on the next drag.

Plunker Example

I've created a Plunker example which replicates the problem. Follow these steps:

  1. Open Developer Tools (F12)
  2. Drag and throw map
  3. Try and drag map again
  4. Error is thrown and written to the console

Update

Question stack trace and title have been updated to match what is caught in Ionic 2 beta 10

Track on GitHub

This issue has been raised on the ZoneJS GitHub page so you can track it here

Will.Harris
  • 4,004
  • 2
  • 24
  • 37
  • 1
    I'm seeing the same thing. did you figure out the issue or find a workaround? – Allan Nienhuis May 27 '16 at 00:47
  • Not figured it out yet, im unsure if its related to Google's API or just zone.js failing to do something during asynchronous calls. It doesn't really affect the end user so i'm not spending too much time worrying about it yet. Hopefully somebody will come along and provide a fix or maybe it will require an update to Angular2 or the Google API – Will.Harris May 27 '16 at 11:32
  • thanks - I'm in the same place. parking it for now. – Allan Nienhuis May 28 '16 at 02:29

1 Answers1

1

Just to notify anyone who hasn't followed the issue on GitHub (the one I linked in this question) this error has now been fixed in version v0.16.7 of ZoneJS

Will.Harris
  • 4,004
  • 2
  • 24
  • 37