mapbox / mapbox-gl-directions

Directions plugin for mapbox-gl-js using Mapbox Directions API.
https://mapbox.com/mapbox-gl-js/example/mapbox-gl-directions/
ISC License
235 stars 124 forks source link

mapbox-gl-directions@4.4.1 is not compatible with peer dep mapbox-gl@2.6.1 #299

Open Yashkanekar opened 1 year ago

Yashkanekar commented 1 year ago

Could not resolve dependency: peer mapbox-gl@"^0.41.0 <2.0.0" from @mapbox/mapbox-gl-directions@4.1.1 node_modules/@mapbox/mapbox-gl-directions @mapbox/mapbox-gl-directions@"^4.1.1" from the root project

jjankovich2 commented 1 year ago

Having the same issue, any luck?

Yashkanekar commented 1 year ago

The peer dep conflict still persists i used npm i -force to install the deps forcefullly to get around the strict warning policies of npm

jjankovich2 commented 1 year ago

Did it work? I had issues when trying to force

kick commented 1 year ago

Did it work? I had issues when trying to force

I also did npm i -force. I'm running NextJS 13.3 React 18. What worked for me was using useSWR to include the component that is loading mapgox-gl-directions

locations.js

import dynamic from "next/dynamic";
const Map = dynamic(() => import("@/components/ui/map"), {
        ssr: false,
    });

map.js

import * as MapboxDirections from "@mapbox/mapbox-gl-directions/dist/mapbox-gl-directions";
`const directions = new MapboxDirections...`
tonviet712 commented 1 year ago

same issue use npm i -force is not good when you have ci/cd

knbap-codes commented 11 months ago

any updates on this?

gerardo-rodriguez commented 9 months ago

Same issue.

$ npm install @mapbox/mapbox-gl-directions --save
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: framework-static@1.1.0
npm ERR! Found: mapbox-gl@2.15.0
npm ERR! node_modules/mapbox-gl
npm ERR!   dev mapbox-gl@"^2.15.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer mapbox-gl@"^0.41.0 <2.0.0" from @mapbox/mapbox-gl-directions@4.1.1
npm ERR! node_modules/@mapbox/mapbox-gl-directions
npm ERR!   @mapbox/mapbox-gl-directions@"*" from the root project
romainlouvet commented 8 months ago

any updates ?