Git Product home page Git Product logo

Comments (13)

rogadev avatar rogadev commented on June 12, 2024 3

I spoke too soon. It installs without the above error tree, but doesn't seem to be there when I attempt to import it.

import MapboxDirections from "@mapbox/mapbox-gl-directions";

Cannot find module '@mapbox/mapbox-gl-directions' or its corresponding type declarations.ts(2307)

from mapbox-gl-directions.

kennydurkin avatar kennydurkin commented on June 12, 2024 1

A recent update to package.json seems to finally address this in the #298 changeset.

Seems like we're now just waiting for them to publish a new version to NPM? cc @chriswhong

from mapbox-gl-directions.

dschnare avatar dschnare commented on June 12, 2024

After review of my suggested change, I believe the range should be this >=0.41.0 <2.0.0.

from mapbox-gl-directions.

chingiz19 avatar chingiz19 commented on June 12, 2024

I have the same issue, let me know if there is a "hacky" solution for the time being

from mapbox-gl-directions.

sezf-opscentral avatar sezf-opscentral commented on June 12, 2024

This wasn't a problem for us until our CI/CD pipeline upgraded to Node 16.15.1 & npm 8.11.0 now we see this error during npm install:

npm ERR! While resolving: @mapbox/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/mapbox-gl
npm ERR!   mapbox-gl@"^1.13.2" from the root project
npm ERR!   peer mapbox-gl@">=0.32.1 <2.0.0" from @mapbox/[email protected]
npm ERR!   node_modules/@mapbox/mapbox-gl-supported
npm ERR!     @mapbox/mapbox-gl-supported@"^1.5.0" from [email protected]
npm ERR!   1 more (ngx-mapbox-gl)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer mapbox-gl@"^0.41.0 <2.0.0" from @mapbox/[email protected]
npm ERR! node_modules/@mapbox/mapbox-gl-directions
npm ERR!   @mapbox/mapbox-gl-directions@"^4.1.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/mapbox-gl
npm ERR!   peer mapbox-gl@"^0.41.0 <2.0.0" from @mapbox/[email protected]
npm ERR!   node_modules/@mapbox/mapbox-gl-directions
npm ERR!     @mapbox/mapbox-gl-directions@"^4.1.0" from the root project

from mapbox-gl-directions.

dennisvd avatar dennisvd commented on June 12, 2024

Example on mapbox website shows mapbox-gl 2.8.2 working together with mapbox-gl-directions 4.1.0

A work-around solution for when you use NPM version > 7 is to run npm install with the --legacy-peer-deps flag
It seems that the new NPM version has a stricter policy when it comes to peer dependencies.

from mapbox-gl-directions.

rogadev avatar rogadev commented on June 12, 2024

Still having this problem today:

$ npm i @mapbox/mapbox-gl-directions
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: [email protected]
npm ERR! node_modules/mapbox-gl
npm ERR!   mapbox-gl@"^2.10.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/[email protected]
npm ERR! node_modules/@mapbox/mapbox-gl-directions
npm ERR!   @mapbox/mapbox-gl-directions@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\ryanr\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ryanr\AppData\Local\npm-cache\_logs\2022-10-31T21_13_30_240Z-debug-0.log

Does install with --legacy-peer-deps but this is almost certainly less than ideal. It's also worth noting that there is still nothing mentioned about this issue in the navigation docs, or on npmjs.com, or general Mapbox docs, as far as I could find. Maybe updates are needed?

These places would be good places to bring attention to the issue:
Docs
NPM

from mapbox-gl-directions.

Tepepaz avatar Tepepaz commented on June 12, 2024

Currently, it does install with --legacy-peer-deps but then it throws an error when launching the app.

error - ./node_modules/@mapbox/mapbox-gl-directions/src/controls/inputs.js:6:0
Module not found: Can't resolve 'fs'

Import trace for requested module:
./node_modules/@mapbox/mapbox-gl-directions/src/directions.js
./node_modules/@mapbox/mapbox-gl-directions/src/index.js

from mapbox-gl-directions.

collier-watkins avatar collier-watkins commented on June 12, 2024

@chriswhong Any updates on this issue?

from mapbox-gl-directions.

snsd0805yoona avatar snsd0805yoona commented on June 12, 2024

Any update on this? @rogadev How do you solve this?

from mapbox-gl-directions.

Vlad-Vasinev avatar Vlad-Vasinev commented on June 12, 2024

Yep, i also faced with this problem "Cannot find module '@mapbox/mapbox-gl-directions'", any suggestions?

from mapbox-gl-directions.

makosdanii avatar makosdanii commented on June 12, 2024

@chriswhong Could you please tell me if there's a solution, or update upcoming? I would use the navigation package for a school project and the deadline is coming :D

from mapbox-gl-directions.

gerardo-rodriguez avatar gerardo-rodriguez commented on June 12, 2024

Hello, I'm curious about updates on this issue as well. Thank you! 🙂


Update: I installed successfully with the --legacy-peer-deps flag, but I then also get an fs app error:

Uncaught TypeError: fs.readFileSync is not a function

It seems to come from the inputs.js file:

Screen Shot 2023-09-20 at 9 39 37 PM
let fs = require('fs'); // substack/brfs#39
let tmpl = template(fs.readFileSync(__dirname + '/../templates/inputs.html', 'utf8'));

Update: This worked for me to get around this issue: #261 (comment)

from mapbox-gl-directions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.