-
Notifications
You must be signed in to change notification settings - Fork 698
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
Only plain objects, and a few built-ins, can be passed to Client Components from Server Components. Classes or null prototypes are not supported. #1859
Comments
This component renders: import { Html } from "@react-email/html";
import { Body } from "@react-email/body";
import { Section } from "@react-email/section";
import { Column } from "@react-email/column";
export default function Email() {
return (
<Html lang="en">
<Body style={{ backgroundColor: "#61dafb" }}>
<Section>
</Section>
</Body>
</Html>
);
}; |
This one errors: import { Html } from "@react-email/html";
import { Body } from "@react-email/body";
import { Section } from "@react-email/section";
import { Column } from "@react-email/column";
export default function Email() {
return (
<Html lang="en">
<Body style={{ backgroundColor: "#61dafb" }}>
<Section>
<Column style={{ width: "50%" }}>{/* First column */}</Column>
<Column style={{ width: "50%" }}>{/* Second column */}</Column>
</Section>
</Body>
</Html>
);
} |
The issue seems to be quite specific, might be caused by many things, that is why you should create a minimal reproduction. Can you create a minimal Next.JS app with the same error and share it here? |
I got bitten by this as well. In my case I had: <Container>
<Section>
<Column align="left">
fluff
</Column>
<Column align="right">
fluff
</Column>
</Section>
</Container> Adding a <Container>
<Section>
<Row>
<Column align="left">
fluff
</Column>
<Column align="right">
fluff
</Column>
</Row>
</Section>
</Container> Not sure if that's the general problem, just wanted to share 😊 |
Thanks @peter-svensson, I was having the same issue, and wrapping everything with the Row component fixed it. |
Its interesting because i have another project using the same email template and that one works fine (react-components v0.0.15) without wrapping the Row component, something introduced in a new version? Also using this template throws the same error <Html>
<Head />
<Preview>🔔 Subscription Event</Preview>
<Body style={{ margin: "auto", marginTop: "auto", backgroundColor: "#BFBFBF", fontFamily: "sans-serif" }}>
<Container style={{ margin: "auto", maxWidth: "650px", backgroundColor: "#FFF" }}>
<Header logo={"/logo_white.svg"} primaryColor={"#2253FF"} title={`🔔 Subscription Event`} />
<Section style={{ padding: "20px", paddingBottom: "0px", paddingTop: "0px" }}>
<Text>ff</Text>
</Section>
<Footer />
</Container>
</Body>
</Html>
``` |
This was because my child component also had a Column without a Row wrapper. |
Throwing my case in here since it might help someone else. I did not have I can also reproduce it by just nesting a |
exactly the same issue. my case was the following: <Section className="bg-fgColor uppercase w-64 px-4 py-2 text-textColor">
<Column>
{etc...}
</Column>
<Column>
{etc...}
</Column>
</Section> enclosing the columns in a |
Describe the Bug
I'm using react-email within my current next.js 15 app router project.
This is a new project but ive got a similar setup with the pages router in another project.
I keep getting an error whenever I try to embed anything in the component.
Which package is affected (leave empty if unsure)
No response
Link to the code that reproduces this issue
private
To Reproduce
create a new nextjs 15 app router app (npx create-t3-app is what i ran)
manually create the emails folder in src/emails.
run the npm run email --dir=src/email
Remove anything from the column component (should render)
Add something within the column component (will crash)
Expected Behavior
Renders the email template
What's your node version? (if relevant)
node 18.19.1, npm 10.2.4
The text was updated successfully, but these errors were encountered: