Solution for error using latest react email and error renderToReadableStream

if you facing an Error to import classnames, etc. , you need to

upgrade node.js version to lts version 18.19.0

for Error Attempted import error: 'renderToReadableStream' is not exported from 'react-dom/server' (imported as 'renderToReadableStream').

you need to install extra packages below from @react-email

npm i @react-email/render

hope it helps

4 Likes

I tried with the
npm i @react-email/render
but i even got more errors.

After changing the package.json to
@react-email/components”: “0.0.12”,
“react-email”: “1.10.0”,

and installed then it worked fine.
Maybe you have to delete the old folder in node_modules

1 Like

this is the latest react email, i mention in the title this thread

3 Likes

Thank you!!! This one helps :slight_smile:

I was unsuccessful with the suggestions above in my environment. However, the automatic install did work correctly the first time (In it’s own directory structure.).

I resolved the problem by placing the email request in an ‘api’ using Next’s ‘route.js’. Putting the outbound request in a server object gave me a working model to build from. I’m not sure how it would work in the suggested configuration but CORS was another factor I found needed to be contended with and the server side request skirted the problem. I also backed off the version of Next to 13.5.6. I was looking at comments out of this series: renderToReadableStream not found in react-dom/server · Issue #868 · resend/react-email · GitHub.