Skip to content

react-render does not work with bun compile binary #2585

@thibaultleouay

Description

@thibaultleouay

Describe the Bug

when compiling a binary using bun with react-email components it does not work and throw :

125 | //#region src/node/render.tsx
126 | const render = async (node, options) => {
127 |   const suspendedElement = /* @__PURE__ */ jsx(Suspense, { children: node });
128 |   const reactDOMServer = await import("react-dom/server").then((m) => m.default);
129 |   let html$1;
130 |   if (Object.hasOwn(reactDOMServer, "renderToReadableStream") && typeof WritableStream !== "undefined") html$1 = await readStream(await reactDOMServer.renderToReadableStream(suspendedElement, { progressiveChunkSize: Number.POSITIVE_INFINITY }));
                  ^
TypeError: undefined is not an object (evaluating 'Object.hasOwn(reactDOMServer, "renderToReadableStream")')
      at <anonymous> (node_modules/@react-email/render/dist/node/index.mjs:130:13)

Bun v1.3.0 (macOS arm64)

Which package is affected (leave empty if unsure)

No response

Link to the code that reproduces this issue

https://github.com/thibaultleouay/bug-bun-react-email

To Reproduce

bun install
bun run build
./app

Expected Behavior

sending the email :)

What's your node version? (if relevant)

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions