Version
v24.13.0
Platform
Subsystem
No response
What steps will reproduce the bug?
Node.js process cannot resolve the DNS SRV records used by the mongodb+srv:// connection string.
import express from "express";
import connectDB from "./db.js";
const app = express();
app.use(express.json());
// Start server with error handling
app.listen(PORT, (err) => {
if (err) {
console.error("Server startup error:", err.message);
process.exit(1);
}
console.log(`Server is running on port ${PORT}`);
connectDB();
});
npm run start
How often does it reproduce? Is there a required condition?
Just need a express app with mongoose lib to connect mongoDB connection string
What is the expected behavior? Why is that the expected behavior?
Server is running on port 5000
MongoDB connected
What do you see instead?
Server is running on port 5000
MongoDB connection error: querySrv ECONNREFUSED _mongodb._tcp.cryptomarketplace.uaakapd.mongodb.net
Failed running 'index.js'. Waiting for file changes before restarting...
Additional information
No response
Version
v24.13.0
Platform
Subsystem
No response
What steps will reproduce the bug?
Node.js process cannot resolve the DNS SRV records used by the
mongodb+srv://connection string.npm run start
How often does it reproduce? Is there a required condition?
Just need a express app with mongoose lib to connect mongoDB connection string
What is the expected behavior? Why is that the expected behavior?
What do you see instead?
Additional information
No response