Skip to content

Regex using unsupported syntax with Safari 16.3 and prior... #6

Description

@rretlaw

I'm using React Email and I installed it into my main webapp which uses Tailwind. I'm building the emails in a section in the app and rendering and pushing the HTML versions to the server for sending. All good - no issues. But when I access the webapp from Safari (iphone or Safari browser), I was getting a compile error. I traced it to the node_module tw-to-css, which is using a regex expression that has an unsupported syntax ("safari doesn't support look-behind"). It was throwing the error in the bundle.js code and I was able to trace it to the tw-to-css module, which is of course used by the react-email/tailwind component. I commented out the React-Email imports and recompiled and pushed to the server and it resolved the issue. In searching it more, discovered the look-behind is supported in Safari (16.4+ - https://caniuse.com/js-regexp-lookbehind) but not before.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions