-
Notifications
You must be signed in to change notification settings - Fork 575
Description
Describe the bug
The email app build command fails when run from apps/email
because it cannot find a ./emails
folder within that directory. The react-email CLI defaults to looking for templates in a ./emails
directory relative to where the command is run, but no such directory exists in apps/email
. The project's email templates are actually located in packages/email/templates
.
next-forge version
I am using version latest (main branch)
To Reproduce
Steps to reproduce the behavior:
- Navigate to the project root directory
- Run
turbo build --filter=email
- See the build fail with error message
Error output:
> [email protected] build /home/user/studyberserk/apps/email
> email build
✖ Checking if ./emails folder exists
ELIFECYCLE Command failed with exit code 1.
Expected behavior
The email app should build successfully, creating the preview app in .react-email
directory and completing the turbo build process without errors.
Root Cause & Fix
The build
and export
scripts in apps/email/package.json
were missing the --dir
flag to specify the correct templates directory, while the dev
script correctly included it.
Fix: Update the scripts to include the --dir
flag:
{
"scripts": {
"build": "email build --dir ../../packages/email/templates",
"export": "email export --dir ../../packages/email/templates"
}
}
Desktop:
- OS: Linux (RHEL 9.6)
- Node.js: v22.18.0
- Package Manager: pnpm
- Turbo: 2.5.3
- react-email: 4.0.15