Skip to content

Preview-server will crash if using dark:* classes in a Tailwind block #3026

@GeekCornerGH

Description

@GeekCornerGH

What versions are you using? (if relevant)

@react-email/components@1.0.8, react-email@5.2.9, @react-email/preview-server@5.2.9

Describe the Bug

Adding a dark:* class to an element inside of a Tailwind block will cause the preview server to crash

What is affected (leave empty if unsure)

Tailwind Component

Link to the code that reproduces this issue

Right here

To Reproduce

  1. Run pnpm dev
  2. Open the template in your browser
  3. It crashes
  4. Remove the dark:* classes and restart the dev server
  5. Open the template in your browser
  6. It won't crash

Expected Behavior

I simply expected the webserver not to crash, or at least to have a proper error message.

Logs attached below:

PS C:\Users\user\Documents\react-emails> pnpm dev

> react-email-starter@1.1.0 dev C:\Users\user\Documents\react-emails
> email dev

    React Email 5.2.9
    Running preview at:          http://localhost:3000

  ✔ Ready in 0.6s

  ✖ Rendering email template test.tsx

 ELIFECYCLE  Command failed with exit code 1.

What's your node version? (if relevant)

v22.20.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions