[types] `Response.body` does not extend `ReadableStream`
See original GitHub issueThe browser’s Response.body
is ReadableStream
.
Based on fetch.d.ts
Response.body
of undici
is just ControlledAsyncIterable
.
The code below is valid and workable.
However, because of fetch.d.ts
I see the warning in my IDE (IntelliJ IDEA).
const response = await fetch(url);
/** @type {ReadableStream} */
const body = response.body; // Warning: "Initializer type ControlledAsyncIterable is not assignable to variable type ReadableStream"
body.getReader();
const response = await fetch(url);
const body = response.body;
body.getReader(); // Warning: "Unresolved function or method getReader()"
Issue Analytics
- State:
- Created a year ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Using readable streams - Web APIs | MDN
The Request.body and Response.body properties are available, which are getters exposing the body contents as a readable stream.
Read more >Argument of type 'ReadableStream<any>' is not assignable to ...
I want to get a Readable form a Blob. import {Readable} from 'stream'; const data: Blob = ...
Read more >Streams—The definitive guide - web.dev
The ReadableStream() constructor creates and returns a readable stream object from the given handlers. There are two types of underlying source:.
Read more >Stream | Node.js v19.3.0 Documentation
The node:stream module is useful for creating new types of stream instances. It is usually not necessary to use the node:stream module to...
Read more >A Guide to Faster Web App I/O and Data Operations with ...
There are only two types of streams in the WHATWG specification, ... If the response body is not a readable stream, a readable...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ah your PR did it! It was just not tagged with “closes #issue” so this would get closed automatically.
I will work on it and make a PR