Turfjs / turf

A modular geospatial engine written in JavaScript and TypeScript

Home Page:https://turfjs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typescript typing error when import "@turf/turf"

ahuigo opened this issue · comments

It seems that there is something wrong with turf's typing.

Please provide the following when reporting an issue:

  • The version of Turf you are using, and any other relevant versions.
turf 6.50

    "typescript": "^5.2.2",
    "vite": "^5.1.6",
    "vitest": "^1.3.1"

node: v21.4.0 
npm: 10.2.4 
pnpm: 8.15.4
  • Snippet of source code or for complex examples
Could not find a declaration file for module '@turf/turf'. '/Users/usr1/proj/node_modules/.pnpm/@turf+turf@6.5.0/node_modules/@turf/turf/dist/es/index.js' implicitly has an 'any' type.
  There are types at '/Users/usr1/proj/node_modules/@turf/turf/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@turf/turf' library may need to update its package.json or typings.ts(7016)
//package.json:
  "dependencies": {
    "@turf/turf": "^6.5.0",
  • Verify this issue hasn't already been reported, or resolved in the latest alpha pre-release.

It's resolved in new version, refer: #2587