TehCheeseT
Deno3y ago
TehCheese

Deno hanging when trying to connect with Mongoose

When I try to connect to MongoDB using Mongoose the whole process just hangs until eventually timing out.
I'm using a remote database with a user and password, and I know the URI is correct because I have used the same one on node.js projects.
just
await mongoose.connect(`${env["MONGO_URI"]}`);

And I know it's getting the URI from the env file, I logged it to console

There's no errors, other than the timeout error.
error: Uncaught (in promise) MongooseServerSelectionError: connection timed out
    at _handleConnectionErrors (file:///C:/Users/che/Documents/GitHub/Guin/node_modules/.deno/mongoose@7.5.0/node_modules/mongoose/lib/connection.js:805:11)
    at NativeConnection.openUri (file:///C:/Users/che/Documents/GitHub/Guin/node_modules/.deno/mongoose@7.5.0/node_modules/mongoose/lib/connection.js:780:11)        
    at eventLoopTick (ext:core/01_core.js:197:13)
    at async file:///C:/Users/che/Documents/GitHub/Guin/Main.ts:23:1
Was this page helpful?