-
Notifications
You must be signed in to change notification settings - Fork 907
fix(react-email): installation failure in build when bumping @react-email/tailwind #2927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(react-email): installation failure in build when bumping @react-email/tailwind #2927
Conversation
|
| Name | Type |
|---|---|
| @react-email/components | Patch |
| @react-email/tailwind | Patch |
| playground | Patch |
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 1 file
Confidence score: 3/5
- There is a concrete runtime risk:
import.meta.dirnameinpackages/react-email/src/commands/build.tswill throw on Node 20.0–20.10 even though those versions are allowed, which can break the build command for supported users. - Severity is moderate and user-impacting (runtime failure), so this isn’t a no-risk merge even though it’s localized to one file.
- Pay close attention to
packages/react-email/src/commands/build.ts- directory resolution relies onimport.meta.dirnamewhich is not available in early Node 20 releases.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/react-email/src/commands/build.ts">
<violation number="1" location="packages/react-email/src/commands/build.ts:19">
P1: `import.meta.dirname` isn’t available in Node 20.0–20.10, but the package allows Node >=20.0.0. This will throw at runtime on supported versions. Use `import.meta.url` (or fileURLToPath) to compute the directory instead.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
This has the trade-off of our current CI not dogfooding the build workflow, but it's the only way currently to avoid the demo build not working when
@react-email/tailwindis bumped, like https://vercel.com/resend/react-email-demo/GYaeyCR2Am9jCGnsV9uw3gv7TsvuThis is equivalent to this exact workaround we had in #2924 that was indeed working.
Summary by cubic
Fixes the preview build by copying node_modules only when running inside the React Email monorepo and skipping dependency installs there. Also sets Turbopack and tracing roots to the monorepo to avoid broken demo builds after package bumps.
Written for commit 9b5a238. Summary will update on new commits.