# Troubleshooting

### MongoDB Connection Issues

- Ensure MongoDB is running
- Check `MONGODB_URI` in `.env.local`
- Verify network connectivity for cloud databases

### Authentication Errors

- Verify `BETTER_AUTH_SECRET` is set (min 32 characters)
- Check that `BETTER_AUTH_URL` matches your domain
- Ensure MongoDB connection is working

### Build Errors

- Clear `.next` folder: `rm -rf .next`
- Reinstall dependencies: `rm -rf node_modules && npm install`
- Check TypeScript errors: `npm run lint`