perliedman / geojson-path-finder

Find shortest path through a network of GeoJSON
https://www.liedman.net/geojson-path-finder/
ISC License
300 stars 86 forks source link

Wrong Position import, build issues #93

Closed zxwild closed 1 month ago

zxwild commented 1 month ago

Hi, I'm unable to build my project, there is the typescript error:

error during build: [vite:dts] Internal Error: Unable to follow symbol for "Position"

I found it's followed by these lines in geojson-path-finder (there are 3 places): import { Position } from "@turf/helpers";

And it looks reasonable, turf/helpers doesn't export the Position type.

Could you the imports this way?

from: import { Position } from "@turf/helpers"; to: import { Position } from 'geojson';

perliedman commented 1 month ago

Hi, not sure what's going on here. The lib builds for me with the imports as they are today (from @turf/helpers). Changing the import like you suggest above breaks the build for me ("Cannot find module 'geojson' or its corresponding type declarations").

Also checked some other projects, and they also import Position from @turf/helpers.

For me, the TypeScript definition seems to come from node_modules/@turf/helpers/dist/js/lib/geojson.d.ts. FWIW, I have version 6.5.0 of @turf/helpers installed.

zxwild commented 1 month ago

FWIW, I have version 6.5.0 of @turf/helpers installed.

That's the thing, I use turf 7.0. Turf 6.5 uses its own types, turf 7 uses geojson package.

Any plans to update to 7.0? 😄 It's released 3 weeks ago and should be the default version since the release.

perliedman commented 1 month ago

Hm, yes using other versions of dependencies than listed in package.json will lead to trouble.

Since I'm not actively working on this project or really have any time to put into open source at the moment, the short answer is "no". I will likely update at some point, but not now.