I am trying to import inside my main.js file a function from the module mapbox-gl-draw-rotate-mode with the following statement: import RotateMode from 'mapbox-gl-draw-rotate-mode'. I get this error:
Uncaught TypeError: Failed to resolve module specifier mapbox-gl-draw-rotate-mode. Relative references must start with either /, ./, or ../. when import in javascript
What I tried to do next is to point the import to the js file of the module. The previous error disappear, but since mapbox-gl-draw-rotate-mode has other dependencies (i.e. @turf), I get back a relative reference error.
I previously created a new project with npm, and then installed the module with npm install.