thedevstockgirl
thedevstockgirl2mo ago

Running into some cryptic error. Help needed.

I am running into some error. This is on React 19, Nextjs 15 and all latest Convex. Has anyone seen this?
No description
19 Replies
erquhart
erquhart2mo ago
Any chance you're using Cloudflare? This React bug mentions Astro specifically but looks very similar: https://github.com/facebook/react/issues/31827 Hmm might not even be cloudflare specific, I think the error message just came from a cloudflare worker that was doing ssr maybe This has popped up in a few other places with different tooling. MessageChannel is a Node API used for SSR, so this error is happening in a non-node context. Another maybe related issue here that does involve Next 15: https://github.com/resend/react-email/issues/1630 This comment from a Vercel team member seems to hit the root of the issue: https://github.com/vercel/next.js/issues/71865#issuecomment-2444377726
thedevstockgirl
thedevstockgirlOP2mo ago
Thank you. Looking into all the links you shared now.
lee
lee2mo ago
interesting that you're getting the same error from next (presumably in a vercel environment) and from the convex environment. neither of them implement MessageChannel. any idea why you might be importing "react-dom/server"?
thedevstockgirl
thedevstockgirlOP2mo ago
Ah. Yes. That's interesting. @erquhart , you saved the day. After much debugging, uninstalling and re-installing, react-email was indeed the culprit. Things worked once I commented out, and used pure html.
No description
thedevstockgirl
thedevstockgirlOP2mo ago
I initially tried jsx-email, but that had a bun of node things that made convex unhappy.
lee
lee2mo ago
hmm i think we want "react-email" to work. we'll look into it. can you share the exact version of react-email and react-dom and other packages that may be relevant (npm ls) 🙏
thedevstockgirl
thedevstockgirlOP2mo ago
Ah. It was not just react-email. Even after I removed react email, attempting to pass anything to the react prop of resend, triggered the same error. Just spent the last hour converting all to pure html with the help of claude. Then using the html prop instead with getSomeTemplate, which returns a html string. No errors. But If I pass the same html to the react prop, it shows the same error I just updated all our packages. So the latest of all relevant package. The only react in the api folder is from resend and react-email. So its def something with react. Once I got rid of that, all works now
thedevstockgirl
thedevstockgirlOP2mo ago
For example, the below does not work
No description
erquhart
erquhart2mo ago
Sounds like react 19 specifically
thedevstockgirl
thedevstockgirlOP2mo ago
Yes
thedevstockgirl
thedevstockgirlOP2mo ago
This works:
No description
thedevstockgirl
thedevstockgirlOP2mo ago
@erquhart Yes. React 19.
Eva
Eva4w ago
Hi! I just ran into this exact issue tonight while trying to install and use react-email. Was there a solution identified?
"react": "^19.0.0",
"react-dom": "^19.0.0",
"@react-email/components": "0.0.32",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"@react-email/components": "0.0.32",
erquhart
erquhart4w ago
Yeah, not using react. There’s a non-working and working example above
Eva
Eva4w ago
RIP I love the simplicity of Convex Auth but might need to switch to Clerk
David Alonso
David Alonso6d ago
Just want to flag that we're having the same issue here, going for pure html for now, but would love to get updates if React 19 works at some point
ballingt
ballingt5d ago
Thanks for flagging, how would you describe the issue @David Alonso, "React emails don't work with React 19 in Convex?" Sounds like it's to do with some Node.js specific APIs? Sounds like we need to prioritize this, but I don't know what the issue is yet. If it's a general runtime API we can add it, but if the issue is that React Email now only supports Node.js for React 19 that's something we need to open an issue about
ballingt
ballingt5d ago
GitHub
Error: A Node.js API is used (MessageChannel) which is not supporte...
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...
David Alonso
David Alonso5d ago
yeah that's how I'd describe it but only based on what solved it for me, which was downgrading to react 18.3 (which is what the auth template uses). I briefly tried the pure HTML approach but that didn't seem to work for me (i might have missed something)

Did you find this page helpful?