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
set up the entry point to the application for the client
constroot=hydrateRoot(document,<App/>);
start the application and visit the page
At this point in development mode everything works as normal
How to recreate the error
Set NODE_ENV to production and follow steps 1-6 and you'll receive
{"name":"Error","message":"Objects are not valid as a React child (found: object with keys {$$typeof, type, key, ref, props, _owner}). If you meant to render a collection of children, use an array instead."}
What is the expected behavior?
The expected behavior is that in production mode , the react 19 application would successfully render with bun renderToReadableStream
What do you see instead?
Instead in production the hydration will fail
Additional information
One way to get the code working is to moneky patch the following code out
react-dom-server.bun.production.js
throwError("Objects are not valid as a React child (found: "+("[object Object]"===childIndex ? "object with keys {"+Object.keys(node$jscomp$0).join(", ")+"}" : childIndex)+"). If you meant to render a collection of children, use an array instead.",);}
however by doing so styles will not load correctly when passing a style from the server
What version of Bun is running?
1.1.8
What platform is your computer?
Darwin 23.4.0 arm64 arm
What steps can reproduce the bug?
How to recreate the error
What is the expected behavior?
The expected behavior is that in production mode , the react 19 application would successfully render with bun renderToReadableStream
What do you see instead?
Instead in production the hydration will fail
Additional information
One way to get the code working is to moneky patch the following code out
react-dom-server.bun.production.js
however by doing so styles will not load correctly when passing a style from the server
I got around this by passing the styles as a prop and using the
<style></style> tag in the component itself.Typically
would work in development mode
The text was updated successfully, but these errors were encountered: