uber / nebula.gl

A suite of 3D-enabled data editing overlays, suitable for deck.gl
https://nebula.gl/
Other
691 stars 165 forks source link

Editor crashes initial render when using latest packages #769

Open jsancho opened 2 years ago

jsancho commented 2 years ago

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 | 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

image
jsancho commented 2 years ago

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.