Run pnpm check:setup first. It names most problems and the fix. See Setup check.
pnpm install fails
- Wrong Node version.
node -vmust be 22.22 or newer. Install the LTS from nodejs.org, open a new terminal and retry. pnpm: command not found. Runcorepack enable, ornpm install -g pnpm.- Half-finished install. Delete every
node_modulesfolder and retry:
pnpm clean && rm -rf node_modules apps/*/node_modules && pnpm install
Can’t connect to MongoDB
| Message contains | Cause | Fix |
|---|---|---|
ECONNREFUSED |
No database at that address | pnpm db:up, or check MONGO_URI |
bad auth / Authentication failed |
Wrong user or password | Re-check the Atlas database user; URL-encode @ : / ? # in the password |
querySrv ENOTFOUND |
Wrong cluster address | Copy the string again from Atlas → Connect |
Server selection timed out |
Atlas blocks your IP | Atlas → Network Access → add your IP |
If data appears in a database called test, your MONGO_URI has no database name. Add /sellzy before the ?.
The admin panel is a blank page
VITE_NEXT_PUBLIC_API_URL is missing in apps/admin/.env. Vite reads .env only at start-up and build time, so restart pnpm dev:admin (or rebuild and redeploy) after changing it.
Requests are blocked by CORS (works locally, fails live)
With NODE_ENV=production the API accepts only CLIENT_URL, ADMIN_URL, PRODUCTION_CLIENT_URL, PRODUCTION_ADMIN_URL and localhost. Set the production ones to the exact browser addresses, with no trailing slash, and restart the API. See Domains and CORS.
Port already in use
EADDRINUSE means something else is using 8000, 3000 or 5173. Stop it, or change PORT in apps/api/.env and every API URL that points at it.
# macOS / Linux
lsof -i :8000
kill <PID>
# Windows
netstat -ano | findstr :8000
taskkill /PID <PID> /F
I can’t sign in to the admin
Set SEED_ADMIN_EMAIL and SEED_ADMIN_PASSWORD in apps/api/.env, then:
pnpm seed:reset-passwords
Everyone gets signed out
JWT_SECRET changed, or differs between API instances. Sign in again and keep one value per environment.
The store is empty or the demo data is broken
pnpm seed # puts back missing demo records
pnpm seed:reset # restores the demo collections exactly as shipped
Card orders stay “pending”
The Stripe webhook isn’t reaching the API. Locally, keep pnpm --filter @sellzy/api webhook running and make sure STRIPE_WEBHOOK_SECRET is the whsec_… it printed. Live, check the endpoint URL and look for failed attempts in Stripe Dashboard → Webhooks.
Image uploads fail in the admin
The provider in DEFAULT_UPLOAD_PROVIDER is missing keys. pnpm check:setup lists which. See Image uploads.
Images don’t show (“hostname is not configured”)
Next.js only loads images from known hosts. Add your image host to images.remotePatterns in apps/web/next.config.ts and restart.
Social sign-in says “isn’t set up yet”
Firebase isn’t configured. See Social sign-in, or use email sign-in.
The mobile app can’t reach the API
Keep pnpm dev:api running. On a real phone, the phone and computer must be on the same Wi-Fi and the firewall must allow port 8000. Or set EXPO_PUBLIC_API_URL to a deployed API and restart with pnpm dev:mobile --clear.
Start completely fresh
docker compose down -v # local database only: deletes all its data
pnpm setup:env --force # backs up your .env files, then recreates them
pnpm db:up && pnpm seed:reset
Your old .env files are kept as .env.backup-<date> next to the new ones.
