Open tsaldanha opened 6 years ago
Having the same problem, did you find a solution?
@abe732 , I make a like direct to the dist/ folder of mabox directions, isnt ideal, but It worked.
for working with angular5, importing this module like this does the trick:
import * as MapboxDirections from '@mapbox/mapbox-gl-directions/dist/mapbox-gl-directions';
Not working anymore in current version
I'm having the same problem...
I solved it using the javascript externally. I'm using nuxt, had to change the externals configuration in webpack.
I'm having the same problem, I can't even start the application. Do the maintainers even reply?
The file that uses fs is: https://github.com/mapbox/mapbox-gl-directions/blob/master/src/controls/inputs.js
Still not working as of Dec 21st 2022
Feb 2023, still not working
not working
May 2023, still not working
for working with angular5, importing this module like this does the trick:
import * as MapboxDirections from '@mapbox/mapbox-gl-directions/dist/mapbox-gl-directions';
This workaround appears to be working for me for the same issue but with Next.js. Thanks @yulivee!
need to export Mapbox_directions like this: const MapboxDirections = require('@mapbox/mapbox-gl-directions/dist/mapbox-gl-directions');
Check out: https://github.com/AndrewTsytsarkin/MapboxDirectionsTypescript
I have a problem with my webpack/react system and I am trying to run the mapbox-gl with mapbox-gl-directions, but I am stuck with this error with the 'fs' that is a dependency of this projects.
ERROR in ./node_modules/@mapbox/mapbox-gl-directions/src/controls/inputs.js Module not found: Error: Can't resolve 'fs' in '/home/tadeu/Projects/lisbon-cycle/node_modules/@mapbox/mapbox-gl-directions/src/controls' @ ./node_modules/@mapbox/mapbox-gl-directions/src/controls/inputs.js 6:9-22 @ ./node_modules/@mapbox/mapbox-gl-directions/src/directions.js @ ./node_modules/@mapbox/mapbox-gl-directions/src/index.js @ ./src/Map/index.js @ ./src/index.js @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/index.js