Closed luichooy closed 2 years ago
I installed got@12 as devDependencies for benchmark test and not use in source directory (src) I guess some tools use it when i run npm run build
npm run build
when i use typescript to compile the project, transpilation errors raised due to got. Errors are as follow:
node_modules/got/dist/source/core/index.d.ts:15:24 - error TS1005: ',' expected. 15 import Options, { type NativeRequestOptions } from './options.js'; ~~~~~~~~~~~~~~~~~~~~ node_modules/got/dist/source/core/index.d.ts:16:15 - error TS1005: ',' expected. 16 import { type PlainResponse, type Response } from './response.js'; ~~~~~~~~~~~~~ node_modules/got/dist/source/core/index.d.ts:16:35 - error TS1005: ',' expected. 16 import { type PlainResponse, type Response } from './response.js'; ~~~~~~~~ node_modules/got/dist/source/core/options.d.ts:21:29 - error TS1005: ',' expected. 21 import http2wrapper, { type ClientHttp2Session } from 'http2-wrapper';
I solved it by downgrading Got to 11.x.x. Because version 11.x.x has no import typesyntax.
import type
I'm confused about whether this is a got problem or a typescript problem
tsconfig.json
{ "compilerOptions": { "target": "es5", "outDir": "./lib", "skipLibCheck": true }, "include": ["src/**/*", "./types/*.d.ts"], }
Duplicate of https://github.com/sindresorhus/got/issues/2129
Describe the bug
Actual behavior
I installed got@12 as devDependencies for benchmark test and not use in source directory (src) I guess some tools use it when i run
npm run build
when i use typescript to compile the project, transpilation errors raised due to got. Errors are as follow:
I solved it by downgrading Got to 11.x.x. Because version 11.x.x has no
import type
syntax.Expected behavior
I'm confused about whether this is a got problem or a typescript problem
Code to reproduce
tsconfig.json
Checklist