Open Zizaco opened 5 hours ago
The same issue occurs with Deno 2.0.1
. Only v2.0.0
works.
$ deno upgrade 2.0.1
Current Deno version: v2.0.0
Downloading https://github.com/denoland/deno/releases/download/v2.0.1/deno-x86_64-unknown-linux-gnu.zip
Deno is upgrading to version 2.0.1
Upgraded successfully to Deno v2.0.1 (stable)
$ deno
Deno 2.0.1
exit using ctrl+d, ctrl+c, or close()
REPL is running with all permissions allowed.
To specify permissions, run `deno repl` with allow flags.
> import { MongoClient } from "mongodb";
undefined
> const mongoClient = new MongoClient("mongodb://127.0.0.1:27017");
undefined
> await mongoClient.connect() // it takes a few seconds to throw
Uncaught MongoServerSelectionError: Cannot read properties of undefined (reading 'setNoDelay')
at Topology.selectServer (file:///home/zizaco/.cache/deno/npm/registry.npmjs.org/mongodb/6.9.0/lib/sdam/topology.js:303:38)
at eventLoopTick (ext:core/01_core.js:214:9)
at async Topology._connect (file:///home/zizaco/.cache/deno/npm/registry.npmjs.org/mongodb/6.9.0/lib/sdam/topology.js:196:28)
at async Topology.connect (file:///home/zizaco/.cache/deno/npm/registry.npmjs.org/mongodb/6.9.0/lib/sdam/topology.js:158:13)
at async topologyConnect (file:///home/zizaco/.cache/deno/npm/registry.npmjs.org/mongodb/6.9.0/lib/mongo_client.js:209:17)
at async MongoClient._connect (file:///home/zizaco/.cache/deno/npm/registry.npmjs.org/mongodb/6.9.0/lib/mongo_client.js:222:13)
at async MongoClient.connect (file:///home/zizaco/.cache/deno/npm/registry.npmjs.org/mongodb/6.9.0/lib/mongo_client.js:147:13)
at async <anonymous>:1:22
>
@Zizaco FYI: The Cannot read properties of undefined (reading 'setNoDelay')
is fixed in 2.0.2
. It was a regression and the reason we pulled 2.0.1
Version: Deno
2.0.1
and2.0.2
MongoDB Package Versionnpm:mongodb@^6.9.0
I was working on a project using MongoDB when I learned that there was a new version available (2.0.2). After upgrading, all my tests started failing, as the new version was unable to establish a database connection.
I was able to isolate and reproduce it directly from the repl:
BTW, it works perfectly with Deno
2.0.0