-
Notifications
You must be signed in to change notification settings - Fork 657
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
Unexpected, unredable characters in generated HTML #1667
Comments
We have also encountered this bug, it occures randomly, any change to the JSX layout or styles may lead to appearing/disappearing of these characters, it seems to be a \0 character |
The code to the reproduction seems to be down, can you make it public? |
Gabriel, I’d like to keep the repository private, but I granted you access. |
Upon some basic investigation, the character involved has hex byes of EF BF BD, and is the https://www.cogsci.ed.ac.uk/~richard/utf-8.cgi?input=%EF%BF%BD&mode=char "REPLACEMENT CHARACTER". It repeats twice in a row a lot of the time. It overwrites the contents of the email rather than inserting itself in between letters. E.g. hex bytes D0 BF for letter "п" were replaced with EF BF BD EF BF BD. The bytes replaced seem random. The replacing characters are always the same replacement character as far as I could reproduce. |
We see the same issue occuring. For us it happens on the "€" Character. I am quite certain that this is not an input encoding problem but rather something that occurs during the rendering of the HTML. Because we do display the € sign in Order Line-Items which are rendered in a loop. Sometimes a single of the looped € Characters is being replaced by the aformentioned �� characters, while the others render fine. It also happens with Umlauts sometimes "äöü". I've never seen it occur in any standard ASCII Character, thus far. |
@KevinGregull @UNOwen What other things about the environment you are using to render can you share (OS, rendering in the browser, in Node, what browser)? |
The issue seems to be universal. I am observing these characters appearing both when rending emails within Cloudflare workers, and while on my macOS desktop in preview mode in the browser. |
Asking this because I'm really not getting any null characters on my side, and I'm running things on Linux with the same email template. It might be something related to Mac in general because the preview server does not call render in the browser |
In my case, I run it on Arch Linux and have the same problem |
Got a reproduction of it, but not in the preview server — only when rendering directly with JavaScript in the browser. |
I am rendering it as a cli application. It's running in the bun docker Container oven/bun. |
Released a fix that worked on my reproduction. Could you all test with |
With these component versions installed, the email appears to be completely blank when rendered on a cloudflare worker and displayed in Firefox browser or email client like Mail. The HTML seems to be in place, but there is some javascript which gets appended and removing the content upon render, and there's a "hidden" attribute on the HTML content. The HTML seems to not have the reported unexpected characters. Text version of the email is not affected, as in it displays well and without unexpected characters. |
@UNOwen Tried with the same email template as the one you sent, and it worked just fine, none of the details you mentioned. The latter script seems to me like a hydration script — you might have called the wrong |
I am using |
Upon upgrading |
Hi, I'm also experiencing the same problem using the greek language, even in the See my minimal reproduction here (make sure you are in the correct branch, which is not the main branch): The produced output in the dev server ( When sending the test email, I do not see the Edit: Forgot to add that the |
@grigmag Thanks for sharing, was able to reproduce, will see into fixing it. But it seems to me as another issue causing this in your case, the problem reported by others here should already be fixed. |
Describe the Bug
When rendering HTML using react-email 3.0.1, I randomly observe unprintable characters rendered in between or instead of the non-latin letters of the email text, no more than 1-2 occurrences per email typically. The issue seems semi-random, dependent on the amount of react markup and text before the affected character, and also dependent on the execution environment (locally rendered preview and server-side cloudflare worker insert these "broken" characters at different parts of the rendered HTML).
Example:
Result:
(note the
�
character)Which package is affected (leave empty if unsure)
react-email
Link to the code that reproduces this issue
https://github.com/UNOwen/litcondit-worker
To Reproduce
Have the below snippet repeated multiple times:
Preview the dev version of emails or render in production. Observe broke characters in the email.
Expected Behavior
No unprintable characters in the email.
What's your node version? (if relevant)
No response
The text was updated successfully, but these errors were encountered: