react-three-map icon indicating copy to clipboard operation
react-three-map copied to clipboard

react-three-map/maplibre imports from mapbox.

Open vespasianvs opened this issue 9 months ago • 1 comments

  • three version: 0.174.0
  • @react-three/fiber version: 9.1.0
  • react-three-map version: 0.8.2
  • node version: 22.14.0
  • npm (or yarn) version: (npm) 10.9.2

Problem description:

I'm using maplibre. When I do the import of the package using react-three-map/maplibre I get warnings as it's looking for mapbox-gl. It looks like there is an issue with the vite setup maybe, as the file dist/maplibre/es/main3.js ends up with imports from mapbox-gl and react-map-gl (should be react-map-gl/maplibre). Not sure what is happening with the vite process - will investigate if I can find time.

Relevant code:

As described - importing the maplibre package results in bad internal imports.

Suggested solution:

The actual source file looks correct, so it looks like it's something going on with how the package is built. Not had much time to investigate though. If I can find time, then I will look.

vespasianvs avatar Apr 08 '25 07:04 vespasianvs

@vespasianvs can you try with our @next release? (npm i react-three-map@next or yarn add react-three-map@next)

Also, be aware maplibre >= 5 doesn't seem to work at the moment, but should work with latest v4 ( https://github.com/RodrigoHamuy/react-three-map/issues/137 ).

RodrigoHamuy avatar Apr 08 '25 10:04 RodrigoHamuy

This is working fine with v1.0.0 so happy to close this.

vespasianvs avatar Nov 11 '25 09:11 vespasianvs