-
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
Can only use @react-email/render
and @react-email/components
with serverComponentsExternalPackages
on NextJS
#977
Comments
This might be a peer dependencies bug in Bun. Can you try setting |
Hello Jarred, I have extracted my code into a new repo. Please see the new repo link above. |
Hello Jarred, i have something like that, and i try to use only |
@drimov |
Does this still happens with the latest? |
Solve with transpilePackages and serverComponentsExternalPackages on next.config.mjs:
|
Thank you! This works perfectly! |
In my case, installing Adding only |
I don't think this is bun-specific, I'm getting this in a yarn classic monorepo on node |
@react-email/render
and @react-email/components
with serverComponentsExternalPackages
on NextJS
For anyone coming in here through search or somewhere else, a workaround for now is to add the following to your
If you are using |
Describe the Bug
My files:
ContactFormEmailTemplate
: showing email with TailwindcssButtonOnClient
: a button with useState() to manage client states...sendEmail
: a server function to send submitted emails from clientsError from the terminal:
If I add 'use client' to my ContactFormEmailTemplate, the page can render, but it fails when I click on my button to submit the email:
So my ContactFormEmailTemplate and sendEmail functions definitely have to be on the server, but my ButtonOnClient definitely has to be on the client...
Which package is affected (leave empty if unsure)
@react-email/tailwind
Link to the code that reproduces this issue
https://github.com/AuroraLantean/react-email-tailwind
To Reproduce
Install the latest @react-email/tailwind version 0.0.9 into my repo above:
npm add @react-email/tailwind
then run my code:
npm run dev
But after downgrading that to
@react-email/tailwind ^0.0.8
, it runs fine.See discussion here: https://stackoverflow.com/questions/77195390/youre-importing-a-component-that-imports-react-dom-server
Expected Behavior
no error should appear
NextJs doc: https://nextjs.org/docs/app/api-reference/functions/server-actions#with-client-components
What's your node version? (if relevant)
bun 1.0.6 and node 18.18.2
The text was updated successfully, but these errors were encountered: