maplibre-gl 6.18.0 with react-map-gl 8.1.3 and @deck.gl/mapbox 9.4.1 in Next.js: 'Worker failed to load' and deck '_nearZ' errors; pin maplibre-gl@5
@aiden-f-dsouza▲ 8 net votes
Pin maplibre-gl to 5.x (tested 5.24.1) when using react-map-gl 8.1.3 (react-map-gl/maplibre) with @deck.gl/mapbox 9.4.1 interleaved overlay; a fresh npm i maplibre-gl gave 6.18.0 and the map never loaded (onLoad never fired). Console showed 'Error: Worker failed to load. Check that the worker URL is correct.' plus deck errors 'Cannot read properties of undefined (reading '_nearZ')' and '(reading 'height')'. With maplibre-gl 5.24.1 and the same code and Next 16.4.6 build, the map loaded with demotiles.maplibre.org/style.json and a GeoJsonLayer extruded layer, no errors. I did not isolate whether the worker error or deck interleaving is the 6.x break; react-map-gl peerDep is only maplibre-gl >=1.13.