Closed sguignot closed 7 years ago
@sguignot thanks for reporting this issue! could you please provide a jsfiddle / jsbin that reproduces this error?
it is possible that https://github.com/mapbox/mapbox-gl-js/pull/3681 fixes this exception, so I'd like to verify before investigating further.
thanks!
👍 after some investigation, I suspect this is a different issue from #3681, but we haven't been able to reproduce it so far 😬 a jsfiddle doing so would be very helpful!
Closing pending reproduction steps
mapbox-gl-js versions: 0.27, 0.28, 0.29, 0.30 Not reproduced with 0.26, this bug is present in all versions since 0.27.
Uncaught TypeError: Cannot read property 'length' of null
(browsers on which I reproduce this error: Google Chrome 55 and Safari 10).Uncaught TypeError: Cannot read property 'length' of null
at new CollisionTile
at Tile.reloadSymbolData
at Tile.done
at Actor.receive
Please re-open, this issue is blocker for us (it occurs more often than in your demo).
I am getting these as well (version 0.30.0):
Uncaught TypeError: Cannot read property 'length' of null
at new CollisionTile (eval at <anonymous> (0.50f3799….js:263), <anonymous>:157:670)
at Tile.reloadSymbolData (eval at <anonymous> (0.50f3799….js:263), <anonymous>:101:1495)
at Tile.t (eval at <anonymous> (0.50f3799….js:263), <anonymous>:101:2104)
at Actor.receive (eval at <anonymous> (0.50f3799….js:263), <anonymous>:213:738)
CollisionTile @ mapbox-gl.js?31ef:157
Tile.reloadSymbolData @ mapbox-gl.js?31ef:101
t @ mapbox-gl.js?31ef:101
Actor.receive @ mapbox-gl.js?31ef:213
And I am indeed using a geojson layer.
@sguignot can you please try reproducing this again and posting the properties of this
(Tile
instance) on the breakpoint where it happens (in either done
or reloadSymbolData
)? I'm specifically interested in the values of this.state
and this.collisionBoxArray
.
@mourner sorry for the delay.
I ran the demo "Restaurants Complaints NYC" with https://api.tiles.mapbox.com/mapbox-gl-js/v0.30.0/mapbox-gl-dev.js
I put conditional breakpoint on line 49 of file collision_tile.js (condition is !collisionBoxArray
)
line 49: if (collisionBoxArray.length === 0) {
When the error occurs (ie !collisionBoxArray
), I have this.state : "reloading"
and this. collisionBoxArray : null
. You will find the detailed context for each frame of the call stack below:
@mourner it seems a lot easier to reproduce this error when spinning the map using the right click, check out the following screencast:
@sguignot finally managed to reproduce, thanks a lot for the help! On it now.
Reproduced with the same steps with mapbox 0.37 and 0.38.
I can also reproduce on master — will produce a minimal example.
https://jsbin.com/sujonoyupa/edit?html,output — error appears after clicking the button a few times.
@lbud Thanks for the jsbin, do you have any news regarding the bugfix?
We have a lot of logs/alerts in production because of this regression, it would be great to have a fix in the next version (v0.39).
I'm having the same problem in production
@sguignot @edap would you be willing to see if the error is still happening on master? I think it was fixed in https://github.com/mapbox/mapbox-gl-js/commit/caf4cfb058b5060dffee5ccb7795a9b5add7d20a as I can no longer reproduce on master.
Closing for now – please reopen if you continue to see this issue after the next release (this afternoon)
This is still happening for me on 0.39.1
.
Thanks @mollymerp it's fixed on my side, I just tested with 0.39.1 and errors are gone.
For quick testing, you can reproduce the error in 0.38 here after a few clicks: https://jsbin.com/sonuvoyofe/1/edit?html,output
Here in 0.39.1 you can check error is gone: https://jsbin.com/hoyaputude/1/edit?html,output
I'm going to deploy 0.39.1 in production soon, then after a few days I will confirm if the error is completely gone or if it persists (there may be several root causes after all).
yeah also happening to me occasional when zooming or using the fly-method... I'm using custom tileset and style.
Error:
ERROR TypeError: Cannot read property 'length' of null at new CollisionTile (mapbox-gl.js:337) at Function.CollisionTile.deserialize (mapbox-gl.js:337) at Tile.reloadSymbolData (mapbox-gl.js:215) at mapbox-gl.js:215 at Actor.receive (mapbox-gl.js:397) at t.invokeTask (polyfills.js:3) at Object.onInvokeTask (core.es5.js:4140) at t.invokeTask (polyfills.js:3) at r.runTask (polyfills.js:3) at Worker.invoke (polyfills.js:3)
using 0.39.1 via npm, with webpack 3.4.1 and excluded mapbox from uglifier (exports.module.noParse = /(mapbox-gl)\.js$/;
) in an ionic2-app (angular4)
@EbilPanda @brncsk sorry you're still running into this – can you cut a new issue with a jsfiddle/jsbin that can reproduce the issue?
i'm sorry I'm currently not able to reproduce the error on fiddl/bin :( I think the problem is with webpack/uglify that stills running over the already uglified code and then occures error, I think I will go with the cdn to test if it happends there too
But i found the error line in the mapbox-gl-devjs: Line 23052 if (collisionBoxArray.length === 0)
I've attached to scope-variables directly before the error occured (Line 23051).
mapbox.scope.json.txt
It also still happens for me in version 0.39.1.
I made an example in jsfiddle: https://jsfiddle.net/stighef/y5z4cwLt/
A FeatureCollection with 10 000 rectangles are toggled on and off when the zoomend-event is triggered.
After zooming out and in, I get lots of these:
@mollymerp I reopen the issue because the jsfiddle from @shf123 triggers the error with version 0.39.1
Yeah, still an issue for me in 0.39.1 as well.
Yeah happening for me on 0.39.1 as well
Thanks a lot for the new test case — got it to immediately reproduce! Will make fixing much easier.
Hey everyone, we have a fix in #5185 — until we ship this in a release, feel free to use this patch for a custom build of GL JS if you experience this problem.
mapbox-gl-js version: 0.28 Not reproduced with 0.26 ; Maybe present in 0.27 too.
Steps to Trigger The Error
Uncaught TypeError: Cannot read property 'length' of null
Error