Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tsconfig lib option and node-fetch #40

Closed
alanbacon opened this issue Aug 25, 2022 · 1 comment
Closed

tsconfig lib option and node-fetch #40

alanbacon opened this issue Aug 25, 2022 · 1 comment

Comments

@alanbacon
Copy link

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.
@jsynowiec
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants