Troubleshooting
Common issues
1) Missing environment variable ...
Fix:
- Copy
.env.example→.env.local - Fill required values
- Restart
pnpm dev
cp .env.example .env.local
pnpm dev2) Database connection refused / timeout
Fix:
- Start Docker services
- Verify the DB port is correct
- Check
DATABASE_URL
docker compose up -d
docker psIf you changed DB credentials, recreate containers (⚠️ deletes local DB):
docker compose down -v
docker compose up -d3) Migrations fail / schema mismatch
Fix:
- Ensure DB is up
- Re-run migrations
- If your tool supports it, reset dev DB (⚠️ deletes data)
Examples:
pnpm db:migrate
pnpm db:seedPrisma reset (⚠️ deletes data):
pnpm prisma migrate reset4) Auth callback / redirect URI mismatch
Symptoms:
- Login loops
- “callback URL mismatch” from provider
Fix:
- Ensure
NEXT_PUBLIC_APP_URL(andAUTH_URL/NEXTAUTH_URL) matcheshttp://localhost:3000 - Update OAuth provider redirect URIs to include your local callback URL
- Restart dev server after changes
5) Port already in use
Fix:
- Stop the process using the port or change the port
Mac/Linux quick check:
lsof -i :30006) Weird build / caching behavior
Fix:
- Clear Next.js cache and reinstall deps if necessary
rm -rf .next node_modules
pnpm install
pnpm dev7) Docker issues (permissions / won’t start)
Fix:
- Ensure Docker Desktop is running
- Try restarting Docker
- On Linux, ensure your user can run Docker without sudo (team policy dependent)
What to include when escalating
When asking for help, include:
- exact command you ran
- full error output (first ~30–50 lines)
- your OS + Node version (
node -v) - whether Docker is running (
docker ps) - whether the issue is new or reproducible
Last updated on