Skip to content

Conversation

@gabrielmfern
Copy link
Member

@gabrielmfern gabrielmfern commented Feb 3, 2026

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/tailwind is bumped, like https://vercel.com/resend/react-email-demo/GYaeyCR2Am9jCGnsV9uw3gv7Tsvu

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

  • Bug Fixes
    • Detects monorepo context and copies node_modules into .react-email only in that case.
    • Skips installDependencies in monorepo; keeps installs outside the monorepo.
    • Sets turbopack.root and outputFileTracingRoot to the monorepo root for correct tracing.
    • Normalizes paths and updates copy filter to ignore .next/.turbo and conditionally node_modules.

Written for commit 9b5a238. Summary will update on new commits.

@gabrielmfern gabrielmfern requested a review from a team February 3, 2026 12:37
@gabrielmfern gabrielmfern self-assigned this Feb 3, 2026
@gabrielmfern gabrielmfern requested review from CarolinaMoraes and removed request for a team February 3, 2026 12:37
@changeset-bot
Copy link

changeset-bot bot commented Feb 3, 2026

⚠️ No Changeset found

Latest commit: 9b5a238

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets
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

@vercel
Copy link

vercel bot commented Feb 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-email Ready Ready Preview, Comment Feb 3, 2026 1:13pm
react-email-demo Ready Ready Preview, Comment Feb 3, 2026 1:13pm

Request Review

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 3, 2026

Open in StackBlitz

npm i https://pkg.pr.new/resend/react-email@2927

commit: 9b5a238

@gabrielmfern gabrielmfern changed the title fix: copy node_modules when in our monorepo only fix(react-email): installation failure in build when bumping @react-email/tailwind Feb 3, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a 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.dirname in packages/react-email/src/commands/build.ts will 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 on import.meta.dirname which 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.

@gabrielmfern gabrielmfern merged commit a52215d into canary Feb 3, 2026
17 checks passed
@gabrielmfern gabrielmfern deleted the fix/dont-install-packages-in-our-monorepo branch February 3, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants