Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncaught TypeError: Cannot read property 'ca' of null when dragging Google Map

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

like image 230
Will.Harris Avatar asked Nov 09 '22 14:11

Will.Harris


1 Answers

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

like image 196
Will.Harris Avatar answered Nov 15 '22 07:11

Will.Harris