Skip to content

Conversation

@gabrielmfern
Copy link
Member

This is intended for #1486. The issue was that we were using a require to
dynamically import in the Node stream module so that we could read through
react-dom's stream only when running in Node, and since we wanted for this to
work on the browser as well, we compromised into using a dynamic require.

The issue with that was that, in ESM-only builds, this was erroring with stuff like:

Error: Dynamic require of "stream" is not supported

The more optimal way of doing what we tried doing there is to have a different
build for the browser and for Node so that we can just import and avoid having
to dynamically do so. This PR does exactly that, and it should fix these issues.
It does make it a bit more complicated in the exports section of the
package.json though, so it is something to consider.

@vercel
Copy link

vercel bot commented Jun 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-email ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2024 5:18pm
react-email-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2024 5:18pm

@gabrielmfern gabrielmfern merged commit 3699e26 into canary Jun 6, 2024
@gabrielmfern gabrielmfern deleted the fix/esm-issue-with-render branch June 6, 2024 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants