Skip to main content

Database

Symptom: Users or watchlists are not showing up, or data appears in the test database instead of SignalisticsDB.Cause: The MONGODB_URI is missing the database name.Fix: Ensure your connection string includes /SignalisticsDB?:
# Correct
mongodb+srv://user:pass@cluster.mongodb.net/SignalisticsDB?retryWrites=true&w=majority

# Wrong
mongodb+srv://user:pass@cluster.mongodb.net/?retryWrites=true&w=majority
Possible causes:
  1. MongoDB Atlas is not allowing connections from Vercel’s IPs — add 0.0.0.0/0 to the Atlas Network Access list
  2. Connection string credentials are incorrect
  3. Cluster is paused or unavailable
Verify your connection:
npx tsx scripts/list-collections.ts
If you previously had data in the test database:
  1. Update MONGODB_URI to include /SignalisticsDB?
  2. Existing users will need to re-register (old accounts won’t work)
  3. Use MongoDB Atlas UI or Compass to manually migrate any data you need to preserve

Authentication

Cause: The user signed up but never verified their email, or the verification link was broken.Fix:
  1. Check if BETTER_AUTH_URL is correctly set to your production domain
  2. Verify the user’s emailVerified field in MongoDB:
db.user.findOne({ email: "user@example.com" })
// Should show: emailVerified: true
  1. If false, the user needs to verify again — clear the user and have them re-register:
npx tsx scripts/clear-users.ts
Symptom: Auth state is inconsistent, user appears logged in but gets errors.Fix:
  1. Clear browser cookies for your domain
  2. Try in incognito/private browsing
  3. Better Auth might have a stale session — clearing cookies forces a fresh login
Possible causes:
  • The token has expired (verification: 24h, magic link: 5min, password reset: 1h)
  • The link was already used (tokens are one-time use)
  • BETTER_AUTH_SECRET differs between environments
Fix: Request a new token (re-send verification email, request new magic link, etc.)

Deployment

Common causes:
  1. Missing environment variables — check all required variables are set
  2. TypeScript errors — run npm run build locally first
  3. Dependency issues — ensure package-lock.json is committed
After updating variables in Vercel:
  1. Go to Deployments tab
  2. Click on the latest deployment
  3. Select Redeploy — env var changes require a new deployment