Open brettwillis opened 3 months ago
Hey guys it's been a while and no triage. Are "byob" streams intentionally not implemented?
// test.js
Bun.serve({
host: 'localhost',
port: '8080',
async fetch(req) {
const reader = await req.body?.getReader({ mode: 'byob' });
return new Response('done');
}
});
Then curl http://localhost:8080 -d 'Hello'
.
1 | Bun.serve({
2 | host: 'localhost',
3 | port: '8080',
4 | async fetch(req) {
5 | const reader = await req.body?.getReader({ mode: 'byob' });
^
TypeError: ReadableStreamBYOBReader needs a ReadableByteStreamController
at /Users/..../test.js:5:36
at fetch (/Users/..../test.js:4:15)
POST - / failed
Docs claim that ReadableStream
is fully implemented https://bun.sh/docs/runtime/nodejs-apis#readablestream. Am I the only one encountering this?
What version of Bun is running?
1.1.21+70ca2b76c
What platform is your computer?
Darwin 23.5.0 arm64 arm
What steps can reproduce the bug?
Send request with body to the Bun server,
request.body.getReader()
throws when trying to obtain aReadableStreamBYOBReader
.What is the expected behavior?
ReadableStream should support byob mode.
What do you see instead?
TypeError: ReadableStreamBYOBReader needs a ReadableByteStreamController
Additional information
No response