TypeScript errors in turf 6 (TS2304 and TS2312)
See original GitHub issueI’ve updated @turf/turf from 5.1.6 to 6.3.0 and now TypeScript is complaining about the following when I transpile my project:
node_modules/@turf/center-median/dist/js/index.d.ts:59:29 - error TS2304: Cannot find name 'Position'.
59 medianCandidates: Array<Position>;
~~~~~~~~
node_modules/@turf/clusters-dbscan/dist/js/index.d.ts:3:38 - error TS2312: An interface can only extend an object type or intersection of object types with statically known members.
3 export interface DbscanProps extends Properties {
~~~~~~~~~~
node_modules/@turf/clusters-kmeans/dist/js/index.d.ts:2:38 - error TS2312: An interface can only extend an object type or intersection of object types with statically known members.
2 export interface KmeansProps extends Properties {
~~~~~~~~~~
My tsconfig.json:
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"allowJs": false,
"allowSyntheticDefaultImports": true,
"target": "es2019",
"noImplicitAny": true,
"strictNullChecks": true,
"noImplicitThis": true,
"noImplicitReturns": true,
"moduleResolution": "node",
"preserveSymlinks": true,
"sourceMap": true,
"outDir": "dist",
"baseUrl": ".",
"paths": {
"*": [
"node_modules/*",
"src/types/*",
]
},
"typeRoots": [
"./node_modules/@types",
"./src/types"
]
},
"include": [
"src/**/*",
"test/**/*"
]
}
I just tried with 6.2.0 and that gives the same issue. For now, I’ve reverted back to 5.1.6
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:12 (2 by maintainers)
Top Results From Across the Web
Getting error TS2304: Cannot find name 'Buffer' - Stack Overflow
Following code working fine in JavaScript. When I am writing same thing in TypeScript and compiling, I am getting Buffer is not find...
Read more >TypeScript errors and how to fix them
Common Errors Below you find a list of common TypeScript errors along with the buggy code and its fixed version.
Read more >Resolve TypeScript TS2304 compilation errors in Visual Studio
I have recently updated my angular2 project and fell into this TS2304 error in Visual Studio 2015 Error TS2304 Build:Cannot find name ...
Read more >TypeScript error TS2304 cannot find name require - Edureka
The error that I'm getting is the "TS2304: Cannot find name 'require' " when I attempt to transpile a simple TypeScript Node.js page....
Read more >[VS 2022] Javascript Content Files Project errors when using ...
I have installed dotnet 6.0.100 using Visual Studio 2022. Ran the commands to upgrade from angular 12 to angular 13 (which has a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Your typescript settings are likely more strict than Turf’s. I’m hoping to enable all the strictness but in the meantime you might want to look into the
skipLibCheck
option.https://www.typescriptlang.org/docs/handbook/compiler-options.html
Submitted PR (#2044).