Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Typescript@next Errors when finding Promise #313

Closed
wheresrhys opened this issue Oct 31, 2020 · 1 comment
Closed

Typescript@next Errors when finding Promise #313

wheresrhys opened this issue Oct 31, 2020 · 1 comment

Comments

@wheresrhys
Copy link

On this line https://github.com/wheresrhys/fetch-mock/blob/master/types/fetch-mock-tests.ts#L200 I get the following error.

Error: /Users/wheresrhys/Projects/fetch-mock/types/fetch-mock-tests.ts:200:1
ERROR: 200:1  expect  TypeScript@next compile error:
Type 'PromiseConstructor' is not assignable to type 'new (executor: (resolve: () => void, reject: () => void) => void) => Promise<Response>'.
  Types of parameters 'executor' and 'executor' are incompatible.
    Types of parameters 'resolve' and 'resolve' are incompatible.
      Type '(value: Response | PromiseLike<Response>) => void' is not assignable to type '() => void'.

    at /Users/wheresrhys/Projects/fetch-mock/node_modules/dtslint/bin/index.js:191:19
    at Generator.next (<anonymous>)
    at fulfilled (/Users/wheresrhys/Projects/fetch-mock/node_modules/dtslint/bin/index.js:6:58)

I'm not really au fait with typescript (I only have the type defs due to demand from users of the library), so have no idea where to start debugging, and not sure if it's a mistake in the defs or a genuine bug

@wheresrhys wheresrhys changed the title Typescript next Errors when finding Promise Typescript@next Errors when finding Promise Oct 31, 2020
@orta
Copy link
Contributor

orta commented Feb 10, 2021

This was likely a "bad" build of TypeScript on master, I wouldn't worry about it (he says ~6 months later) 💯

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

No branches or pull requests

2 participants