-
Notifications
You must be signed in to change notification settings - Fork 50.7k
Closed
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug
Description
In the exports field of the react-dom's package.json, there is no "bun" field. Bun defaults to the "default" field for compatibility. However, the ./server.node.js file doesn't export renderToReadableStream(), while Bun supports Web Streams out of the box.
See: The Bun doc on Module resolution
This issue is similar to #26906, but Bun always supported Web Streams so there is no backwards compatibility issues.
React version: 18.3.1
Steps To Reproduce
- Install
react-dom. - Import
renderToReadableStream() - Run the file using Bun
- Notice that the error is something like this:
SyntaxError: Export named 'renderToReadableStream' not found in module '~/??/node_modules/react-dom/server.node.js'., which clearly shows that Bun uses the default export.
Link to code example:
I am not sure how to use Bun on the browser.
The current behavior
Bun uses the default export. (aka server.node.js)
The expected behavior
Bun uses a custom "bun" export. (aka server.browser.js)
I have tested the following change locally and it completely fixes this issue:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug
