nebula.gl
nebula.gl copied to clipboard
Editor crashes initial render when using latest packages
Describe the bug
Here's a sandbox with a reproduction of the error.
It's the most vanilla CRA setup with typescript and the latest dependencies. react @ 18.0.0 mapbox-gl @ 2.8.2 react-map-gl @ 7.0.15 react-map-gl-draw @ 1.0.3
https://codesandbox.io/s/nostalgic-framework-pyfqer
Actual Result
I've created a tiny Function Component that fails to render and shows this error message
TypeError: Cannot read properties of undefined (reading 'Consumer') Editor.render C:/source/src/mode-handler.tsx:462 459 | } 460 | 461 | render() { 462 | return ( | ^ 463 | <MapContext.Consumer> 464 | {(context) => { 465 | this._context = context;
Related issues
Looks like this issue could be a duplicate https://github.com/uber/nebula.gl/issues/745
Screenshots

For the time being, I've managed to get things working by downgrading react-map-gl to v5 / v6.
Not sure if the issue lies within react-map-gl or react-map-gl-draw, I'm going to crosslink the issue with their repo so more knowledgeable folk can chip in.