-
Notifications
You must be signed in to change notification settings - Fork 692
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
<Preview> causes emails to appear completely empty in Gmail when certain values are passed #1785
Comments
I also saw some other users mentioning that this was happening when the preview text has 53 characters or above, seems like this is the same exact case as yours I still can't quite understand why this happens, I'll have to investigate |
I seem to not be able to reproduce for some reason. What version of all packages are you using? |
Having similar issue. For me, it happens when the text string has more then 57 chars.
Packages version: |
Can confirm this happens in a fresh install of Steps to reproduce: pnpm create email
cd react-email-starter
pnpm install
pnpm dev
# Navigate to http://localhost:3001/preview/stripe-welcome?view=desktop {
"dependencies": {
"@react-email/components": "0.0.29",
"react-dom": "18.3.1",
"react": "18.3.1"
},
"devDependencies": {
"@types/react": "18.3.4",
"@types/react-dom": "18.3.0",
"react-email": "3.0.3"
}
} |
Super weird... So the default
But this DOES render:
And this DOES render:
But this DOES NOT render:
So it doesn't appear to be based on character count. |
For some reason, the problem also seems to go away when using React 19 instead of 18. |
The error seems to be caused by |
Ok, I think I figured it out, mostly. I've long known that React 18 has a weird tendency to insert null-byte characters in some places of the HTML, and it seems like they come exactly inside the rendered part of the Preview. The issue is that Prettier seems to just give up on parsing the AST when it finds these null-byte characters. As a workaround for now, I'm going to change it so that all null-byte characters are removed before prettifying. |
Describe the Bug
When using the
<Preview>
component with text values from an array (e.g.,problemTitles
), the email appears completely empty in Gmail. However, if a simple text string such as"Bug report"
is passed, the email renders correctly.Screenshots:
- This shows the empty email issue.
- This shows the correct rendering when a simple string is passed.
Which package is affected (leave empty if unsure)
@react-email/preview
Link to the code that reproduces this issue
none
To Reproduce
problemTitles
values (e.g.,problemTitles[0]
) as thetitle
prop to<Email >
.Expected Behavior
The email should render correctly with the text passed to the
<Preview>
component displayed in the preview line, and the body content ("Hello World") should also appear.However, when using
problemTitles[0]
orproblemTitles[1]
, the email is completely empty in Gmail.What's your node version? (if relevant)
22
The text was updated successfully, but these errors were encountered: