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
.
@iamanvesh Thanks for building this library for circle support in mapbox-draw-gl.
I am facing the same issue while working withReact 17.0.2
in Typescript
Import statement for CircleMode, DragCircleMode, DirectMode and SimpleSelectMode is throwing the following error:
Could not find a declaration file for module 'mapbox-gl-draw-circle'. 'c:/Users/fe/node_modules/mapbox-gl-draw-circle/index.js' implicitly has an 'any' type. Try
npm i --save-dev @types/mapbox-gl-draw-circle
if it exists or add a new declaration (.d.ts) file containingdeclare module 'mapbox-gl-draw-circle';
ts(7016)
These are the versions of the libraries that I am using:
"@mapbox/mapbox-gl-draw": "^1.3.0",
"mapbox-gl-draw-circle": "^1.1.2",
It would be helpful if you could suggest a solution to this issue and make the library work for my application. Thank you!
@ev0065 @shivalika-techp I'm not actively maintaining this library. I'll try and take a look at this issue this weekend, but feel free to clone and submit a PR for the fix.
@ev0065 @shivalika-techp I'm not actively maintaining this library. I'll try and take a look at this issue this weekend, but feel free to clone and submit a PR for the fix.
There is an open PR for updating mapbox-gl-draw support for this library, merging this will also be helpful- https://github.com/iamanvesh/mapbox-gl-draw-circle/pull/61
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.