Skip to main content

Troubleshooting

Encountering issues during setup or usage? Below are common errors and their solutions.

1. MongoDB Connection Error​

Symptom: Backend server crashes on startup with MongoTimeoutError or MongoNetworkError. Solution:

  • Ensure your MongoDB server is running (if installed locally).
  • If using MongoDB Atlas, check that your IP address is whitelisted in the Network Access tab.
  • Verify that your MONGODB_URI string in the .env file is correct and properly formatted without missing characters.

2. npm/yarn Install Error​

Symptom: Running npm install or yarn fails with generic ERR! messages. Solution:

  • Delete node_modules folder and package-lock.json or yarn.lock, then run npm cache clean --force and try again.
  • Verify your Node.js version. Some dependencies require a specific version. We recommend v16.x or v18.x.
  • Ensure you have a stable internet connection.

3. Build Error​

Symptom: yarn build or npm run build fails on the frontend. Solution:

  • Check the console output for syntax errors in the code.
  • Ensure all environment variables used in the frontend (e.g., REACT_APP_...) are correctly defined in your .env before building.
  • Check if your server has enough RAM. Insufficient memory (e.g., a 512MB VPS) can cause build processes to terminate unexpectedly.

4. API Error (CORS or 404)​

Symptom: The frontend cannot communicate with the backend, displaying CORS errors in the browser console. Solution:

  • Ensure the backend server is running.
  • Verify that the frontend .env points exactly to the backend URL (e.g., http://localhost:5000 or https://api.yourdomain.com).
  • On the backend, ensure the CORS middleware is configured to accept requests from your frontend domain.

5. Authentication Error​

Symptom: Unable to login, getting "Invalid Credentials" or "Token Expired". Solution:

  • Ensure you registered the user successfully.
  • Check if the JWT_SECRET in the backend .env is set correctly. If the secret changes, all existing tokens become invalid.
  • Clear your browser cookies and local storage, and try logging in again.

6. Payment Error​

Symptom: Payment gateway integration fails during transactions. Solution:

  • Verify that you are using the correct API keys (Publishable vs. Secret keys).
  • Ensure your payment gateway account is active and not restricted.
  • If testing, make sure you are using Sandbox/Test keys and not Live keys.

7. Email Error​

Symptom: Registration emails, password resets, or inquiry emails are not being sent. Solution:

  • Verify the SMTP/Email service API credentials in your .env.
  • Some cloud providers (like DigitalOcean or AWS) block SMTP port 25 or 465 by default to prevent spam. Check your firewall settings.
  • Check the logs of your email provider (e.g., SendGrid) to see if emails are bouncing.

8. Environment Variable Error​

Symptom: Application behaves unpredictably or certain features don't load. Solution:

  • Ensure you have renamed .env.example to .env.
  • Restart your server! Node.js and React/Next.js processes must be restarted for any .env changes to take effect.