[GH-ISSUE #1757] Named export 'tailwindToCSS' not found due to CommonJS incompatibility in @react-email/tailwind@0.0.9 #506

Open
opened 2026-02-26 18:47:20 +03:00 by kerem · 8 comments
Owner

Originally created by @anujpandeyy on GitHub (Apr 22, 2025).
Original GitHub issue: https://github.com/documenso/documenso/issues/1757

Issue Description

When using version 0.0.9 of @react-email/tailwind, the build fails with a named export error related to the tw-to-css package. This is because tw-to-css is a CommonJS module, and tailwindToCSS cannot be used as a named import in this context.

Downgrading to version 0.0.8 of @react-email/tailwind resolves the issue.

Steps to Reproduce

  1. Install @react-email/tailwind@0.0.9

  2. Run the build process: npm run build

  3. Observe the following error:

bash
Copy
Edit
Named export 'tailwindToCSS' not found. The requested module 'tw-to-css' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export.

Expected Behavior

The build should complete successfully, and the tailwindToCSS utility should be available without causing module import errors.

Current Behavior

The build fails due to a module resolution error when importing tailwindToCSS as a named export from a CommonJS module (tw-to-css).

Screenshots (optional)

No response

Operating System [e.g., Windows 10]

Windows 10

Browser [e.g., Chrome, Firefox]

Chrome

Version [e.g., 2.0.1]

@react-email/tailwind@0.0.9

Please check the boxes that apply to this issue report.

  • I have searched the existing issues to make sure this is not a duplicate.
  • I have provided steps to reproduce the issue.
  • I have included relevant environment information.
  • I have included any relevant screenshots.
  • I understand that this is a voluntary contribution and that there is no guarantee of resolution.
  • I want to work on creating a PR for this issue if approved
Originally created by @anujpandeyy on GitHub (Apr 22, 2025). Original GitHub issue: https://github.com/documenso/documenso/issues/1757 ### Issue Description When using version 0.0.9 of @react-email/tailwind, the build fails with a named export error related to the tw-to-css package. This is because tw-to-css is a CommonJS module, and tailwindToCSS cannot be used as a named import in this context. Downgrading to version 0.0.8 of @react-email/tailwind resolves the issue. ### Steps to Reproduce 1. Install @react-email/tailwind@0.0.9 2. Run the build process: npm run build 3. Observe the following error: bash Copy Edit Named export 'tailwindToCSS' not found. The requested module 'tw-to-css' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export. ### Expected Behavior The build should complete successfully, and the tailwindToCSS utility should be available without causing module import errors. ### Current Behavior The build fails due to a module resolution error when importing tailwindToCSS as a named export from a CommonJS module (tw-to-css). ### Screenshots (optional) _No response_ ### Operating System [e.g., Windows 10] Windows 10 ### Browser [e.g., Chrome, Firefox] Chrome ### Version [e.g., 2.0.1] @react-email/tailwind@0.0.9 ### Please check the boxes that apply to this issue report. - [x] I have searched the existing issues to make sure this is not a duplicate. - [x] I have provided steps to reproduce the issue. - [x] I have included relevant environment information. - [ ] I have included any relevant screenshots. - [x] I understand that this is a voluntary contribution and that there is no guarantee of resolution. - [x] I want to work on creating a PR for this issue if approved
Author
Owner

@github-actions[bot] commented on GitHub (Apr 22, 2025):

Thank you for opening your first issue and for being a part of the open signing revolution!

One of our team members will review it and get back to you as soon as it possible 💚

Meanwhile, please feel free to hop into our community in Discord

<!-- gh-comment-id:2821422134 --> @github-actions[bot] commented on GitHub (Apr 22, 2025): Thank you for opening your first issue and for being a part of the open signing revolution! <br /> One of our team members will review it and get back to you as soon as it possible 💚 <br /> Meanwhile, please feel free to hop into our community in [Discord](https://documen.so/discord)
Author
Owner

@BaoLe106 commented on GitHub (May 5, 2025):

Same issue here

<!-- gh-comment-id:2850035201 --> @BaoLe106 commented on GitHub (May 5, 2025): Same issue here
Author
Owner

@SKATIAGO commented on GitHub (Jun 12, 2025):

Same problem

<!-- gh-comment-id:2966857965 --> @SKATIAGO commented on GitHub (Jun 12, 2025): Same problem
Author
Owner

@pintxxo commented on GitHub (Jun 17, 2025):

Is any update on that issue?

<!-- gh-comment-id:2980096869 --> @pintxxo commented on GitHub (Jun 17, 2025): Is any update on that issue?
Author
Owner

@ephraimduncan commented on GitHub (Aug 23, 2025):

Hello @anujpandeyy are you still facing the same issue on v1.12.1?

<!-- gh-comment-id:3217203360 --> @ephraimduncan commented on GitHub (Aug 23, 2025): Hello @anujpandeyy are you still facing the same issue on v1.12.1?
Author
Owner

@telegramgooles commented on GitHub (Sep 16, 2025):

same here

<!-- gh-comment-id:3300317302 --> @telegramgooles commented on GitHub (Sep 16, 2025): same here
Author
Owner

@yotarotsukada commented on GitHub (Oct 11, 2025):

I upgraded @react-email/tailwind to 0.1.0 and the error is solved.

https://github.com/resend/react-email/issues/1002

<!-- gh-comment-id:3392871631 --> @yotarotsukada commented on GitHub (Oct 11, 2025): I upgraded `@react-email/tailwind` to `0.1.0` and the error is solved. https://github.com/resend/react-email/issues/1002
Author
Owner

@yotarotsukada commented on GitHub (Oct 11, 2025):

updated: @react-email/tailwind@0.1.0 broke I18n context, and 0.8.0 worked fine.

<!-- gh-comment-id:3392966385 --> @yotarotsukada commented on GitHub (Oct 11, 2025): updated: `@react-email/tailwind@0.1.0` broke I18n context, and `0.8.0` worked fine.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#506
No description provided.