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

Type Error Using Turf.js

bitcooker opened this issue · comments

I have some typescript error.

  • The version of Turf : "@turf/turf": "^6.5.0"

I installed turf.js following the doc.
image

But when I try to use it on my Next.js app (v14), I got a typescript error.

image

This is an error :

Could not find a declaration file for module '@turf/point-on-feature'. '[...Path...]/node_modules/@turf/point-on-feature/dist/es/index.js' implicitly has an 'any' type.
  There are types at '[...Path...]/node_modules/@turf/point-on-feature/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@turf/point-on-feature' library may need to update its package.json or typings.

Hi @bitcooker. This was a known issue with v6.5.0. Try upgrading to v7 where these type definitions have been fixed.