Skip to content

Conversation

@gabrielmfern
Copy link
Member

@gabrielmfern gabrielmfern commented Jan 28, 2026

https://vercel.com/resend/resend-emails/FukkGsK4mphebqtHobAnSLceE5Qh#L287

Since Vercel, and most likely other CI environments will have NODE_ENV=production set, npm install won't include cross-env, which is required for the build command to work in .react-email for email build.

With the --production flag (or when the NODE_ENV environment variable is set to production), npm will not install modules listed in devDependencies. To install all modules listed in both dependencies and devDependencies when NODE_ENV environment variable is set to production, you can use --production=false.
https://docs.npmjs.com/cli/v8/commands/npm-install#description

To fix this, just switching up form using nypm, (since they don't provide a way to define flags for npm like this), and use npm install --production=false as instructed. I've also tried the preview release from this and can confirm it works.


Summary by cubic

Ensure devDependencies install for the .react-email preview server so email builds work in CI (e.g., Vercel) where NODE_ENV=production skips dev deps. Fixes build errors caused by missing cross-env.

  • Bug Fixes
    • Replace nypm install with execSync('npm install --production=false --silent') in $HOME/.react-email to always include devDependencies.

Written for commit c196ea2. Summary will update on new commits.

@changeset-bot
Copy link

changeset-bot bot commented Jan 28, 2026

🦋 Changeset detected

Latest commit: c196ea2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
react-email Patch
@react-email/preview-server Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gabrielmfern gabrielmfern self-assigned this Jan 28, 2026
@vercel
Copy link

vercel bot commented Jan 28, 2026

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

Project Deployment Review Updated (UTC)
react-email Ready Ready Preview, Comment Jan 28, 2026 8:52pm
react-email-demo Ready Ready Preview, Comment Jan 28, 2026 8:52pm

Request Review

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 28, 2026

Open in StackBlitz

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

commit: c196ea2

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.

No issues found across 1 file

@gabrielmfern gabrielmfern requested review from a team and vcapretz and removed request for a team January 28, 2026 16:04
@gabrielmfern gabrielmfern merged commit 1b9df29 into canary Jan 28, 2026
15 of 16 checks passed
@gabrielmfern gabrielmfern deleted the fix/install-including-dev-depednencies branch January 28, 2026 20:54
gabrielmfern added a commit that referenced this pull request Feb 2, 2026
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