-
-
Notifications
You must be signed in to change notification settings - Fork 34.4k
Description
Version
v24.13.0
Platform
Windows 11 x64
Windows Server x64
Subsystem
No response
What steps will reproduce the bug?
- Install Node.js v24.13.0
- Run the following code:
const express = require("express");
const mongoose = require("mongoose")
const app = express();
const connectDB = async () => {
try {
const conn = await mongoose.connect("mongodb+srv://:@cluster0.u0yrsfk.mongodb.net/db_name");
console.log(MongoDB Connected: ${conn.connection.host});
} catch (error) {
console.error('MongoDB connection failed:', error.message);
process.exit(1);
}
};
connectDB();
app.listen(3300, () => {
console.log("mongodb connected at port 3300")
})
How often does it reproduce? Is there a required condition?
Reproduces 100% of the time with Node v24.13.0 on Windows (11 and Server).
Works correctly on Node v24.11.1.
No special conditions beyond a MongoDB SRV connection URI.
What is the expected behavior? Why is that the expected behavior?
The connection should succeed, as it does in Node v24.11.1.
This is expected because Node.js v24.13.0 should maintain compatibility with network/DNS operations that were functional in v24.11.1.
What do you see instead?
node:internal/dns/promises:294
this.reject(new DNSException(err, this.bindingName, this.hostname));
^
Error: querySrv ECONNREFUSED _mongodb._tcp.cluster0.u0yrsfk.mongodb.net
at QueryReqWrap.onresolve [as oncomplete] (node:internal/dns/promises:294:17) {
errno: undefined,
code: 'ECONNREFUSED',
syscall: 'querySrv',
hostname: '_mongodb._tcp.cluster0.u0yrsfk.mongodb.net'
}
Node.js v24.13.0
Additional information
