-
-
Notifications
You must be signed in to change notification settings - Fork 969
Closed
Labels
Description
Describe the bug
- Node.js version: 16.15.0
- OS & version: Windows 11
Actual behavior
Requiring got and transpiling with Typescript 4.7 raises transpilation errors
node_modules/got/dist/source/core/options.d.ts(763,22): error TS2709: Cannot use namespace 'CacheableLookup' as a type.
node_modules/got/dist/source/core/options.d.ts(764,26): error TS2709: Cannot use namespace 'CacheableLookup' as a type.
node_modules/got/dist/source/core/options.d.ts(775,21): error TS2709: Cannot use namespace 'CacheableLookup' as a type.
node_modules/got/dist/source/core/options.d.ts(776,25): error TS2709: Cannot use namespace 'CacheableLookup' as a type.
node_modules/got/dist/source/core/options.d.ts(1125,29): error TS2709: Cannot use namespace 'CacheableLookup' as a type.
Code to reproduce
package.json
{
"name": "got-ts4.7-regression",
"version": "1.0.0",
"type": "module",
"dependencies": {
"got": "^12.1.0"
},
"devDependencies": {
"typescript": "^4.7.2"
}
}
tsconfig.json
{
"compilerOptions": {
"module": "Node16",
"moduleResolution": "Node16",
"target": "es6",
},
"exclude": [
"node_modules"
]
}
"moduleResolution": "Node16" is apparently required for Typescript 4.7 support of the exports
field in package.json
Checklist
- I have read the documentation.
- I have tried my code with the latest version of Node.js and Got.
screendriver, akowald, bodrovis, Baune8D, Hacksore and 7 more