react-email
react-email copied to clipboard
Ionic - Capacitor | Tailwind breaks build on Xcode
Describe the Bug
Hi team,
Thank you for this awesome library.
I am facing an issue: I cannot build on Xcode for any IOS device with Capacitor using react-email/tailwind.
Which package is affected (leave empty if unsure)
@react-email/tailwind
Link to the code that reproduces this issue
-
To Reproduce
Steps to reproduce:
- Import and use in Tailwind
import { Tailwind } from '@react-email/tailwind';
...
const RenderEmail: any = () => {
return (
<Html>
<Tailwind>
<Body>
</Body>
</Tailwind>
</Html>
);
};
-
Sync Capacitor
capacitor sync ios -
On Xcode, run on any device
-
See error in logs
------ STARTUP JS ERROR ------
⚡️ SyntaxError: Invalid regular expression: invalid group specifier name
⚡️ URL: http://192.168.1.2:8101/static/js/bundle.js
⚡️ [error] - {"line":444536,"sourceURL":"http://192.168.1.2:8101/static/js/bundle.js"}
⚡️ bundle.js:444536:0
The line 444536 in bundle shows:
let e = /*#__PURE__*/(0,____node_modules_babel_runtime_helpers_esm_wrapRegExp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(/(?<=\.)[^{]+\s*\{([^{}]*(?:(?<=;)\s*\n\r?[^{}]*)*)\s*\}/gm, {
If I don't import Tailwind, the error is gone.
Expected Behavior
No error on build
What's your node version? (if relevant)
0.0.8
That is probably due to the look-behind regex expressions on the tailwind component and on one of its dependencies, there is a PR underway that doesn't use these anymore, but for now this is a workaround for it.