pgc4d
pgc4d copied to clipboard
TypeScript compile error in Deno 1.6
Importing the package errors in Deno 1.6.
Output of deno --version
:
deno 1.6.0 (release, x86_64-pc-windows-msvc)
v8 8.8.278.2
typescript 4.1.2
And here is the error message:
error: TS2322 [ERROR]: Type '(value: T | PromiseLike<T>) => void' is not assignable to type 'Resolve<T>'.
Types of parameters 'value' and 'value' are incompatible.
Type 'T | PromiseLike<T> | undefined' is not assignable to type 'T | PromiseLike<T>'.
Type 'undefined' is not assignable to type 'T | PromiseLike<T>'.
methods = { resolve, reject }
~~~~~~~
at https://deno.land/x/[email protected]/src/utils.ts:21:25
The expected type comes from property 'resolve' which is declared here on type '{ resolve: Resolve<T>; reject: Reject; }'
let methods: { resolve: Resolve<T>, reject: Reject }
~~~~~~~
at https://deno.land/x/[email protected]/src/utils.ts:19:24