jsynowiec/node-typescript-boilerplate

tsconfig lib option and node-fetch

alanbacon opened this issue · 1 comments

What is the purpose of

"lib": ["ES2022"],

in the tsconfig file?


If it isn't needed can it be removed as it seems to cause the following build errors with node-fetch:

node_modules/fetch-blob/from.d.ts:20:64 - error TS2749: 'File' refers to a value, but is being used as a type here. Did you mean 'typeof File'?

20 export function fileFrom(path: string, type?: string): Promise<File>;
                                                                  ~~~~

node_modules/fetch-blob/from.d.ts:25:60 - error TS2749: 'File' refers to a value, but is being used as a type here. Did you mean 'typeof File'?

25 export function fileFromSync(path: string, type?: string): File;
                                                              ~~~~

node_modules/formdata-polyfill/esm.min.d.ts:2:11 - error TS2749: 'FormData' refers to a value, but is being used as a type here. Did you mean 'typeof FormData'?

2   new (): FormData;
            ~~~~~~~~

node_modules/formdata-polyfill/esm.min.d.ts:3:14 - error TS2749: 'FormData' refers to a value, but is being used as a type here. Did you mean 'typeof FormData'?

3   prototype: FormData;
               ~~~~~~~~

node_modules/formdata-polyfill/esm.min.d.ts:5:50 - error TS2749: 'FormData' refers to a value, but is being used as a type here. Did you mean 'typeof FormData'?

5 export declare function formDataToBlob(formData: FormData): Blob;
                                                   ~~~~~~~~

node_modules/node-fetch/@types/index.d.ts:124:4 - error TS2749: 'FormData' refers to a value, but is being used as a type here. Did you mean 'typeof FormData'?

124  | FormData
       ~~~~~~~~

node_modules/node-fetch/@types/index.d.ts:137:22 - error TS2749: 'FormData' refers to a value, but is being used as a type here. Did you mean 'typeof FormData'?

137  formData(): Promise<FormData>;
                         ~~~~~~~~


Found 7 errors in 3 files.

Errors  Files
     2  node_modules/fetch-blob/from.d.ts:20
     3  node_modules/formdata-polyfill/esm.min.d.ts:2
     2  node_modules/node-fetch/@types/index.d.ts:124
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! node-typescript-boilerplate@0.0.0 build: `tsc -p tsconfig.json`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the node-typescript-boilerplate@0.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Closing, as not related to this repository. See node-fetch/node-fetch#1617 for more information on your problem, and https://www.typescriptlang.org/tsconfig if you want to learn more about the TSConfig file.