"Operation users.findOne()
buffering timed out after 10000ms. Operation products.distinct()
buffering timed out after 10000m."
I'm not succeeding in solving this error, I've been stuck here for more than a week now:(
The backend is not working at all when deploying my app to Heroku (locally it works fine). I'm using MERN.
I'm really frustrated because of this problem, I'm so close to getting my app to production but this is making it impossible.
If anyone could give me a hand I would really appreciate it, and if you'd like to see any other file just let me know!
Sever.js
import express from 'express';
import mongoose from 'mongoose';
import dotenv from 'dotenv';
import path from 'path';
dotenv.config();
const app = express();
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
mongoose.connect(`mongodb+srv://${process.env.DB_USER}:${process.env.DB_PASS}@name.0xzkc.mongodb.net/${process.env.DB_NAME}?retryWrites=true&w=majority&ssl=true`,{
useNewUrlParser: true,
useUnifiedTopology: true,
useCreateIndex: true,
}).then(console.log('working'));
app.use('/api/uploads', uploadRouter);
app.use('/api/users', userRouter);
app.use('/api/products', productRouter);
app.use('/api/orders', orderRouter);