Troubleshooting
Start with the setup doctor:
Start with the setup doctor:
bun check-envThen run the smallest command that reproduces the problem.
Dependency Or Workspace Issues
Install from the repository root:
bun installCheck workspace consistency:
bun run lint:repoIf generated build state is stale, clean workspace outputs:
bun clean:workspacesRead the root clean script before using it. It removes ignored files through
git clean.
Environment Errors
Run:
bun check-envCommon causes:
- Missing
NEXT_PUBLIC_CONVEX_URLinapps/app/.env. - Missing
NEXT_PUBLIC_CONVEX_SITE_URLinapps/app/.env. - Missing
CONVEX_SITE_URL,SITE_URL, orBETTER_AUTH_SECRETinpackages/backend/.env. - Backend variables set locally but not in the Convex dashboard.
BILLING_PROVIDERset without the selected provider's required variables.
Convex Issues
Start Convex directly:
bun dev:convexIf the backend starts locally but deployed functions fail, check that Convex
environment variables are set in the Convex dashboard. Convex does not read
packages/backend/.env at runtime after deployment.
Do not manually edit generated files in:
packages/backend/convex/_generatedRegenerate them with the Convex CLI when needed.
Auth Issues
Check these first:
NEXT_PUBLIC_APP_URLinapps/app/.env.SITE_URLinpackages/backend/.envand Convex env.BETTER_AUTH_SECRETinpackages/backend/.envand Convex env.- OAuth callback URLs in Google or Microsoft provider settings.
AUTH_TRUSTED_ORIGINSfor alternate local or preview origins.
Google callback:
http://localhost:3000/api/auth/callback/googleMicrosoft callback:
http://localhost:3000/api/auth/callback/microsoftEmail Issues
For magic links and transactional email:
- Set
RESEND_API_KEYinpackages/backend/.env. - Set
RESEND_API_KEYin Convex env. - Use verified sender domains in production.
- When using Resend's shared test sender, send only to the permitted test recipient for your account.
Preview email templates locally:
bun dev:emailBilling Issues
If billing is not part of your current setup, leave BILLING_PROVIDER unset.
If billing is enabled:
- Confirm
BILLING_PROVIDERmatches the provider:polar,stripe, orlemon_squeezy. - Confirm all provider IDs map to the catalog in
packages/backend/convex/billing/catalog.ts. - Confirm provider webhook secrets are set in Convex env.
- Confirm webhooks point to the Convex site URL, not a Next.js route.
Checkout creation should not grant access by itself. Verified provider webhooks grant and revoke access.
Next.js App Issues
Run focused builds:
bun --cwd apps/app build
bun --cwd apps/marketing buildRun focused typechecks:
bun --cwd apps/app typecheck
bun --cwd apps/marketing typecheckThe product app runs on port 3000; the marketing site runs on port 3002.
Verification Commands
Use these when a fix is ready:
bun run lint
bun run typecheck
bun run testFor production confidence:
bun run build