-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed as not planned
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
Description
π Search Terms
- ReadableStream
π Version & Regression Information
I'm using 5.3.2.
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about ReadableStream/differences in environments
β― Playground Link
No response
π» Code
const rs: AsyncIterable<Uint8Array> = new ReadableStream<Uint8Array>();
π Actual behavior
tsc reports the following error:
Property '[Symbol.asyncIterator]' is missing in type 'ReadableStream<Uint8Array>' but required in type 'AsyncIterable<Uint8Array>'.
That property should not have been missing in ReadableStream
.
π Expected behavior
No error, because the Streams WHATWG Living Standard documents that ReadableStream is an async iterable: https://streams.spec.whatwg.org/#rs-asynciterator
Additional information about the issue
Admittedly, this isn't widely supported. At time of writing, it may be that just 3 runtimes support it:

Live data: https://caniuse.com/mdn-api_readablestream_--asynciterator
Note: The browser-compat-data calls this feature "experimental", but I'm not sure what the basis for that is. See mdn/browser-compat-data#22676 h/t @fatcerberus for explaining this classification
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created