placemark / togeojson

convert KML, TCX, and GPX to GeoJSON, without the fuss
https://placemark.github.io/togeojson/
BSD 2-Clause "Simplified" License
409 stars 67 forks source link

Bugs #76

Closed PriFefis closed 2 years ago

PriFefis commented 2 years ago

I tried to use v >= 5, however this error occurs:

ERROR in node_modules/@tmcw/togeojson/dist/index.d.ts(8,42): error TS2315: Type 'Generator' is not generic. node_modules/@tmcw/togeojson/dist/index.d.ts(27,42): error TS2315: Type 'Generator' is not generic. node_modules/@tmcw/togeojson/dist/index.d.ts(82,42): error TS2315: Type 'Generator' is not generic.

When I used version 4.7, I found the following errors: image

But I can't install in that directory. Can you help me, please?

kthyer commented 2 years ago

For v5, did you install 5.0.0-5?

For v4.7, the library has no TS declarations at that point in time so you have to add it to your own .d.ts file, even if your own declarations add no types.

This can be as simple as creating a module.d.ts (this can be .d.ts) and then declaring the module.

Inside module.d.ts add declare module "@tmcw/togeojson"

tmcw commented 2 years ago

Hi! It looks like you're using a very old version of TypeScript - generators became generic in 2019 with the 3.6 release. I'd recommend upgrading TypeScript, which should resolve the issue.

tmcw commented 2 years ago

Closing - would recommend upgrading TypeScript to use 5.x