web-streams-polyfill icon indicating copy to clipboard operation
web-streams-polyfill copied to clipboard

Upgrading to Typescript 4.9 results in error TS2322 when using web-streams-polyfill

Open helenmg88 opened this issue 2 years ago • 0 comments

Hello!! We have a type error when do this:

window.ReadableStream = ReadableStream;

Error:

Type 'typeof ReadableStream' is not assignable to type '{ new (underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number | undefined; } | undefined): ReadableStream<Uint8Array>; new <R = any>(underlyingSource: UnderlyingDefaultSource<...>, strategy?: QueuingStrategy<...> | undefined): ReadableStream<...>; new <R = any>(underlyingSource?: UnderlyingSourc...'.
  Types of parameters 'underlyingSource' and 'underlyingSource' are incompatible.
    Type 'UnderlyingSource<any> | undefined' is not assignable to type 'UnderlyingByteSource'.
      Type 'undefined' is not assignable to type 'UnderlyingByteSource'.

Do you plan to update the type? Thanks a lot!!

helenmg88 avatar Dec 27 '22 07:12 helenmg88