Database
Data going to the wrong database
Data going to the wrong 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?:Cannot connect to MongoDB in production
Cannot connect to MongoDB in production
Possible causes:
- MongoDB Atlas is not allowing connections from Vercel’s IPs — add
0.0.0.0/0to the Atlas Network Access list - Connection string credentials are incorrect
- Cluster is paused or unavailable
Migrating from 'test' to 'SignalisticsDB'
Migrating from 'test' to 'SignalisticsDB'
If you previously had data in the
test database:- Update
MONGODB_URIto include/SignalisticsDB? - Existing users will need to re-register (old accounts won’t work)
- Use MongoDB Atlas UI or Compass to manually migrate any data you need to preserve
Authentication
'Email not verified' error on sign-in
'Email not verified' error on sign-in
Cause: The user signed up but never verified their email, or the verification link was broken.Fix:
- Check if
BETTER_AUTH_URLis correctly set to your production domain - Verify the user’s
emailVerifiedfield in MongoDB:
- If
false, the user needs to verify again — clear the user and have them re-register:
Stale sessions or cookies
Stale sessions or cookies
Token appears invalid
Token appears invalid
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_SECRETdiffers between environments
Deployment
Build fails on Vercel
Build fails on Vercel
Common causes:
- Missing environment variables — check all required variables are set
- TypeScript errors — run
npm run buildlocally first - Dependency issues — ensure
package-lock.jsonis committed
Environment variables not taking effect
Environment variables not taking effect
After updating variables in Vercel:
- Go to Deployments tab
- Click … on the latest deployment
- Select Redeploy — env var changes require a new deployment