Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: A Node.js API is used (MessageChannel) which is not supported in the Edge Runtime. #1630

Open
tszhong0411 opened this issue Aug 26, 2024 · 1 comment

Comments

@tszhong0411
Copy link

tszhong0411 commented Aug 26, 2024

Describe the Bug

Using React 19 + Next.js 15

I want to use @react-email/render on edge runtime. However, I got this error:

unhandledRejection: Error: A Node.js API is used (MessageChannel) which is not supported in the Edge Runtime.

Which package is affected (leave empty if unsure)

@react-email/render

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/react-email-render-on-edge-runtime-5dlkxp

To Reproduce

  1. Go to /api/email
  2. See the error

Expected Behavior

No errors. And render the component successfully in email.

What's your node version? (if relevant)

No response

@gabrielmfern
Copy link
Collaborator

gabrielmfern commented Aug 27, 2024

Not 100% sure we can do something about this as react-dom, which we use internally, seems to be the one using MessageChannel here. All the other APIs we use are supported on the edge without issues.

I've also noticed that the issue goes away when downgrading the React version and Next version to latest, so I do believe we will have support for MessageChannel and this issue going away soon. That being said, we should keep the issue open until it is fixed on Next. I suppose you can also downgrade React to an RC that did not use MessageChannel yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
@tszhong0411 @gabrielmfern and others