can someone help me in implementing mapbox-gl-directions on an ionic application. im having problems using their package at the npm install --save @mapbox/mapbox-gl-directions
. i tried using a CDN and it works. my problem is that it should be using the npm bundler rather than the CDN because it is a a production application.
when i tried to import it using import MapboxDirections from '@mapbox/mapbox-gl-directions'
and used it
init map
var map = new mapboxgl.Map({ container: 'map', style: 'mapbox://styles/mapbox/streets-v9', center: [-79.4512, 43.6568], zoom: 13 });
//this part of the code below returns the error
map.addControl(new MapboxDirections({ accessToken: mapboxgl.accessToken }), 'top-left');
the application in browser returns me this error Error on NPM bundle Cannot assign to read only property 'exports' of object '[object Object]'
.can someone verify me if its working? i think this might be a bug on the npm module.