Troubleshooting
Common local and production issues with TurboJet.
My environment variables from .env are not being loaded
Run pnpm dev from the repository root (where pnpm-workspace.yaml lives), not from inside an app folder.
Root scripts use dotenv-cli to load variables from the root .env file
(pnpm dev → dotenv -- turbo dev). Prefer .env as the primary file;
Turbo also lists .env.local in globalDependencies if you use one.
Also ensure the variable is listed in the globalEnv array in turbo.json. Only then will Turbo pass it through to tasks that need it.
{
"globalEnv": ["DATABASE_URL", "RESEND_KEY", "NEXT_PUBLIC_MARKETING_URL"]
}Full key reference: Environment.
How do I use the debugger in VS Code?
Add a configuration to .vscode/launch.json. Point cwd at marketing (the API host in this checkout) and envFile at the root .env:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Marketing DEBUG",
"runtimeExecutable": "pnpm",
"runtimeArgs": ["run", "dev"],
"restart": true,
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/apps/marketing",
"envFile": "${workspaceFolder}/.env"
}
]
}For a monorepo-wide pnpm dev from the root, set cwd to ${workspaceFolder} instead.
Tailwind theme changes are not applied
In monorepos, restart the development server after changing theme tokens. If that fails, save the app’s globals.css and hard-refresh the browser.
The application is slow in production
A common cause is latency between the app (or serverless functions) and PostgreSQL. Deploy the app to a region close to your database (Neon, Supabase, Railway, etc.). On Vercel, set the Functions region to match the database region in project settings.
I set SMTP_HOST but email still goes to Resend
Expected. sendViaSmtp exists but the SMTP branch in sendEmail is commented out, so delivery always uses Resend. See Mailpit.