398 | function flushBuffered(destination) {
399 | // Bun direct streams provide a flush function.
400 | // If we don't have any more data to send right now.
401 | // Flush whatever is in the buffer to the wire.
402 | if (typeof destination.flush === 'function') {
403 | destination.flush();
^
TypeError: Expected Sink
code: "ERR_INVALID_THIS"
at flushBuffered (/Users/tomatao/Code/study/discovery/bun-hono/node_modules/react-dom/cjs/react-dom-server.bun.development.js:403:5)
at flushCompletedQueues (/Users/tomatao/Code/study/discovery/bun-hono/node_modules/react-dom/cjs/react-dom-server.bun.development.js:11360:7)
at performWork (/Users/tomatao/Code/study/discovery/bun-hono/node_modules/react-dom/cjs/react-dom-server.bun.development.js:10986:7)
at /Users/tomatao/Code/study/discovery/bun-hono/node_modules/react-dom/cjs/react-dom-server.bun.development.js:8889:14
at scheduleWork (/Users/tomatao/Code/study/discovery/bun-hono/node_modules/react-dom/cjs/react-dom-server.bun.development.js:396:3)
at pingTask (/Users/tomatao/Code/study/discovery/bun-hono/node_modules/react-dom/cjs/react-dom-server.bun.development.js:8888:5)
at ping (/Users/tomatao/Code/study/discovery/bun-hono/node_modules/react-dom/cjs/react-dom-server.bun.development.js:8934:14)
Chunked response is cut off at the sleep
What is the expected behavior?
The server continues to stream the response after the asynchronous task
What do you see instead?
A response only containing the content before the async task and the call to destination.flush() inside React throwing an error related to ERR_INVALID_THIS
What version of Bun is running?
v1.1.8
What platform is your computer?
Darwin 23.4.0 arm64 arm
What steps can reproduce the bug?
Setup project:
Start the server.
Make a request:
Console error:
Chunked response is cut off at the
sleep
What is the expected behavior?
The server continues to stream the response after the asynchronous task
What do you see instead?
A response only containing the content before the async task and the call to
destination.flush()
inside React throwing an error related toERR_INVALID_THIS
Additional information
No response