-
Notifications
You must be signed in to change notification settings - Fork 592
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
Nextjs 13 & 14 app router bug #871
Comments
Hey ! I am having exactly the same issue when using edge/runtime :/ |
I've also found that |
Could you provide an example on how you patch it? |
@maccman Could you please share how you pathed it? 🙏 |
any solutions i also have just encountered this issue |
I'm also encountering this issue. @maccman could you post your solution? |
I just ran into this too, was there a patch posted anywhere? |
I ran into this back in July and made a Discord post about it (the Tailwind component breaking on edge) as well, but no response yet. I fiddled around with react-dom/server but I couldn't get it to work. I'm curious how @maccman worked around all of this. I ended up pre-rendering the email component off of edge with some placeholders and grabbing the HTML, and then at runtime find-replacing the placeholders with the actual values. Horrible workaround, but it's the only way I can get the flow I need to work. |
This SO answer worked for me |
Here's a workaround for now for anyone that's still hitting this issue up:
This should work for Next 13 and 14 alike, something that |
@gabrielmfern Your answer also works if you get this error:
I had outdated versions of "@react-email/render" ("^0.0.7"), updated to 0.0.13 and "@react-email/components" ("0.0.14"), updated to 0.0.17 |
Describe the Bug
I'm getting an error "Unable to import react-dom/server in a server component" when I try to use react-email under a API route using Nextjs' edge runtime and the new
app
dir routing.Following tips from this ticket I've now patched react-email to load react-dom/server dynamically which seems to be working.
Which package is affected (leave empty if unsure)
No response
Link to the code that reproduces this issue
vercel/next.js#43810
To Reproduce
Expected Behavior
Should work!
What's your node version? (if relevant)
No response
The text was updated successfully, but these errors were encountered: