Deck.gl assertion failed uncaught exception is crashing the UI when specifying a customLayer
See original GitHub issueHi, I spent a chunk of time digging into what was happening. For some context I’m rendering DeepMap elements into the UI via the customLayers
prop on the LogViewer
. I followed the documentation here to add a new layer (i.e. new GeoJSONLayer
). However, I noticed that sometimes a really obscure and seemingly random bug happens, where deck.gl asserts that a layer doesn’t have any state when it does. That layer happens to be the customLayer that I added.
When debugging, I noticed that deck.gl is trying to loop through layers and initialize them, in the middle of a ROSBag playback. All of the xvis layers needed to be initialized ( as in I inspected them all while debugging and they didn’t have a state ), however not the GeoJSONLayer
, because its added separately (I believe).
What should I do to fix this?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top GitHub Comments
I encountered a similar error so I’m sharing my workaround in case it is useful to others.
My analysis of the issue is that the streetscape layers are recreated frequently but the layers provided via
customLayers
are not. As a result, the LogViewer logic (or something downstream in deck.gl) tries to initialize the layers assuming they are new which works for the built-in layers but fails for custom layers.In my case, this seems to throw when seeking to a point in the timeline in which the data doesn’t exist yet. When the data comes in, the layers are created and initialized and the error throws.
To work around this, I added a ready check that subscribes to log updates. If at any point I can’t retrieve the current frame, I clear the ready flag until I can and then recreate the layer. Seems to do the trick.
Here’s the bulk of the hook I’m using:
@twojtasz Any update on this? Its a frequent bug that requires a restart of the system, would like to see what we can do to get it fixed 😃 Thanks!