Open ev0065 opened 5 years ago
Are you using typescript? Looks like its complaining because I don't have a declaration file for the module. Can you try adding a declaration file?
@iamanvesh So adding a declaration file with declare module 'mapbox-gl-draw-circle
does not work. I'm still getting the same error as before when compiling. I do not believe that I am using typescript. I am currently using react-mapbox-gl and as well as other wrappers, mainly this one and mapbox draw. Do you have an idea why?
@evan0065 Can you share your package.json configuration and some parts of your code to reproduce this issue?
+1
How to solve it?
`./node_modules/mapbox-gl-draw-circle/lib/modes/CircleMode.js Module parse failed: /Users/laoma/Documents/moory/2020.04/bird-map/node_modules/mapbox-gl-draw-circle/lib/modes/CircleMode.js Unexpected token (6:20) You may need an appropriate loader to handle this file type. | const circle = require('@turf/circle'); |
---|---|
const CircleMode = {...MapboxDraw.modes.draw_polygon}; | |
const DEFAULT_RADIUS_IN_KM = 2; | |
`
@moory Did you find a solution to this please?
Getting:~ "Could not find a declaration file for module 'mapbox-gl-draw-circle'. '/home/sharry/frontend/node_modules/mapbox-gl-draw-circle/index.js' implicitly has an 'any' type."
If you are using TypeScript, add declare module 'mapbox-gl-draw-circle';
to your typings.d.ts
.
Hi,
I just updated the packages and received a new error:
In my actual code, I am getting this error when I try to import it:
I wanted to check and see if I was the only one receiving these errors or if my build somehow got screwed up. I did update the other modules that
mapbox-gl-draw-circle
uses but it didn't work.