You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An error is thrown by react-dom/server when serving a request for a serverside-rendered (using renderToReadableSteam) React app that includes a React.Suspense component.
Run React server with Node: bun run ssr:node. Open the app and see that the suspended Button component resolves after 2 seconds and no errors are thrown in the serverside or clientside consoles.
Run React server with Bun; bun run ssr:bun. Open the app and see that the Button component remains suspended after 2 seconds, is resolved in the serverside console but not the clientside console, and the following error is thrown in the server console:
8169 | try {
8170 | var abortableTasks = request.abortableTasks;
8171 | if (0 < abortableTasks.size) {
8172 | var error =
8173 | void 0 === reason
8174 | ? Error("The render was aborted by the server without a reason.")
^
error: The render was aborted by the server without a reason.
at abort (/home/jmuzina/software/work/canonical/repos/react-repro/node_modules/react-dom/cjs/react-dom-server.bun.development.js:8174:13)
at cancel (/home/jmuzina/software/work/canonical/repos/react-repro/node_modules/react-dom/cjs/react-dom-server.bun.development.js:8262:17)
at close (3:17)
What is the expected behavior?
Bun can serve serverside-rendered React applications that include Suspense components, and the Suspense components behave as they do in Node (suspending and displaying fallback content until the component's promises are resolved).
What do you see instead?
Error thrown in server console:
8169 | try {
8170 | var abortableTasks = request.abortableTasks;
8171 | if (0 < abortableTasks.size) {
8172 | var error =
8173 | void 0 === reason
8174 | ? Error("The render was aborted by the server without a reason.")
^
error: The render was aborted by the server without a reason.
at abort (/home/jmuzina/software/work/canonical/repos/react-repro/node_modules/react-dom/cjs/react-dom-server.bun.development.js:8174:13)
at cancel (/home/jmuzina/software/work/canonical/repos/react-repro/node_modules/react-dom/cjs/react-dom-server.bun.development.js:8262:17)
at close (3:17)
Suspense components are not un-suspended until a rerender occurs on the clientside. The page does not fully load unless the user or some code causes a re-rerender.
Additional information
I have also filed a bug with React as I can't tell if this is a bug with react-dom or Bun itself. facebook/react#32159
The text was updated successfully, but these errors were encountered:
Per the React WG, Suspense is intended for use with PipeableStream, not ReadableStream. As far as I can tell, react-dom's Bun renderer does not implement renderToPipeableStream.
What version of Bun is running?
1.1.43
What platform is your computer?
Darwin 24.0.0 arm64 arm
What steps can reproduce the bug?
An error is thrown by
react-dom/server
when serving a request for a serverside-rendered (usingrenderToReadableSteam
) React app that includes aReact.Suspense
component.Reproduction steps:
bun install
bun run ssr:node
. Open the app and see that the suspended Button component resolves after 2 seconds and no errors are thrown in the serverside or clientside consoles.bun run ssr:bun
. Open the app and see that the Button component remains suspended after 2 seconds, is resolved in the serverside console but not the clientside console, and the following error is thrown in the server console:What is the expected behavior?
Bun can serve serverside-rendered React applications that include Suspense components, and the Suspense components behave as they do in Node (suspending and displaying fallback content until the component's promises are resolved).
What do you see instead?
Error thrown in server console:
Suspense components are not un-suspended until a rerender occurs on the clientside. The page does not fully load unless the user or some code causes a re-rerender.
Additional information
I have also filed a bug with React as I can't tell if this is a bug with
react-dom
or Bun itself.facebook/react#32159
The text was updated successfully, but these errors were encountered: