react-email icon indicating copy to clipboard operation
react-email copied to clipboard

Ionic - Capacitor | Tailwind breaks build on Xcode

Open NicoDos opened this issue 3 years ago • 1 comments

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:

  1. Import and use in Tailwind
import { Tailwind } from '@react-email/tailwind';
...
const RenderEmail: any = () => {
return (
    <Html>
      <Tailwind>
        <Body>
        </Body>
      </Tailwind>
    </Html>
  );
};
  1. Sync Capacitor capacitor sync ios

  2. On Xcode, run on any device

  3. 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

NicoDos avatar Sep 02 '23 09:09 NicoDos

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.

gabrielmfern avatar Nov 16 '23 08:11 gabrielmfern