Open
Description
I'm working on updating some parts of an API, and tests as part of an API with typescript version 4.
I'm running tsc --noEmit
without --skipLibCheck flag, and I see multiple typescript errors in logs.
node_modules/jest-fetch-mock/types/index.d.ts:20:39 - error TS2304: Cannot find name 'Response'.
20 extends jest.MockInstance<Promise<Response>, [string | Request | undefined, RequestInit | undefined]> {
~~~~~~~~
node_modules/jest-fetch-mock/types/index.d.ts:20:60 - error TS2304: Cannot find name 'Request'.
20 extends jest.MockInstance<Promise<Response>, [string | Request | undefined, RequestInit | undefined]> {
~~~~~~~
node_modules/jest-fetch-mock/types/index.d.ts:20:81 - error TS2304: Cannot find name 'RequestInit'.
20 extends jest.MockInstance<Promise<Response>, [string | Request | undefined, RequestInit | undefined]> {
~~~~~~~~~~~
node_modules/jest-fetch-mock/types/index.d.ts:21:23 - error TS2304: Cannot find name 'Request'.
21 (input?: string | Request, init?: RequestInit): Promise<Response>;
~~~~~~~
node_modules/jest-fetch-mock/types/index.d.ts:21:39 - error TS2304: Cannot find name 'RequestInit'.
21 (input?: string | Request, init?: RequestInit): Promise<Response>;
~~~~~~~~~~~
node_modules/jest-fetch-mock/types/index.d.ts:21:61 - error TS2304: Cannot find name 'Response'.
21 (input?: string | Request, init?: RequestInit): Promise<Response>;
~~~~~~~~
node_modules/jest-fetch-mock/types/index.d.ts:44:31 - error TS2304: Cannot find name 'Request'.
44 isMocking(input: string | Request): boolean;
~~~~~~~
node_modules/jest-fetch-mock/types/index.d.ts:97:57 - error TS2304: Cannot find name 'Request'.
97 export type UrlOrPredicate = string | RegExp | ((input: Request) => boolean);
~~~~~~~
node_modules/jest-fetch-mock/types/index.d.ts:99:50 - error TS2304: Cannot find name 'Request'.
99 export type MockResponseInitFunction = (request: Request) => Promise<MockResponseInit | string>;
~~~~~~~
I have found that this error is possibly related to Request
type coming from typescript browser dom
library, which is missing in node.js projects, hence causing the missing type.
I found similar issues in github: meilisearch/meilisearch-js#661
Metadata
Metadata
Assignees
Labels
No labels