Comments (13)
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.
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.
After review of my suggested change, I believe the range should be this >=0.41.0 <2.0.0
.
from mapbox-gl-directions.
I have the same issue, let me know if there is a "hacky" solution for the time being
from mapbox-gl-directions.
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.
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.
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.
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.
@chriswhong Any updates on this issue?
from mapbox-gl-directions.
Any update on this? @rogadev How do you solve this?
from mapbox-gl-directions.
Yep, i also faced with this problem "Cannot find module '@mapbox/mapbox-gl-directions'", any suggestions?
from mapbox-gl-directions.
@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.
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:
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)
- Show autocomplete addresses that are close to the users geolocation or map view HOT 1
- Existing route not found HOT 1
- NODE_ENV is undefined, triggers console error in production HOT 6
- Unable to style line colour/width in Directions HOT 2
- setOrigin and setDestination on click HOT 1
- 3 Issues: (1)Text colour issue + (2)Km Vs. Miles + (3)walking directions appearing in the middle of a lake
- Map SetStyle removes direction polyline HOT 1
- Unable to use with MapBox version v2.6.1 HOT 2
- How do you remove picking custom directions with the cursor?
- Missing new params HOT 1
- visualize waypoints
- visualize instructions past first waypoint
- XMLHttpRequest is not defined HOT 10
- Get duration, distance and weight-name to calculate further
- Error thrown when trying to swap departure and arrival
- [email protected] is not compatible with peer dep [email protected] HOT 8
- Missing TypeScript type definitions for mapbox-gl-directions package
- Get more annotations
- CORS Blocked
- Totally exclude ferries instead of avoiding them
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapbox-gl-directions.