react-email: Unexpected, unredable characters in generated HTML
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:
<Text className="text-zinc-600 dark:text-zinc-300 leading-6">
Поздравляю! Вы завершили офлайн-курс по улучшению речи и литературному мастерству Litcondit.
Если вам понравились занятия и вы заинтересованы в том, чтобы научиться виртуозно говорить и писать,
а еще разбираться в литературе, приходите на занятия:
</Text>
Result:
Поздравляю! Вы завершили офлайн-курс по улучшению речи и литерату�рному мастерству Litcondit.
Если вам понравились занятия и вы заинтересованы в том, чтобы научиться виртуозно говорить и писать,
а еще разбираться в литературе, приходите на занятия:
(note the � character)
"@react-email/components": "^0.0.24",
"@react-email/preview": "0.0.11",
"react-email": "3.0.1",
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:
<Text className="text-zinc-600 dark:text-zinc-300 leading-6">
Поздравляю! Вы завершили офлайн-курс по улучшению речи и литературному мастерству Litcondit.
Если вам понравились занятия и вы заинтересованы в том, чтобы научиться виртуозно говорить и писать,
а еще разбираться в литературе, приходите на занятия:
</Text>
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
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 19 (8 by maintainers)
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
@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.
I am rendering it as a cli application. It’s running in the bun docker Container oven/bun.
In my case, I run it on Arch Linux and have the same problem
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.
Gabriel, I’d like to keep the repository private, but I granted you access.