question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught Assertion Error | v0.20.0

See original GitHub issue
$ deno --version
deno 1.5.4 (bc79d55, release, x86_64-unknown-linux-gnu)
v8 8.8.278.2
typescript 4.0.5

db.ts

import { MongoClient } from "https://deno.land/x/mongo@v0.20.0/mod.ts";

const client = new MongoClient();
client.connect('mongodb://localhost:27017');

const db = client.database('test');

$ deno run --allow-net --allow-read --allow-write --allow-plugin --allow-env --unstable db.ts
Check file:///workspace/db.ts
error: Uncaught AssertionError
    throw new AssertionError(msg);
          ^
    at assert (asserts.ts:152:11)
    at MongoClient.database (client.ts:48:5)
    at db.ts:6:19

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

5reactions
hackers267commented, Nov 27, 2020

hello,the resolve is to use

const await client.connect('mongodb://localhost:27017');
0reactions
hackers267commented, Jan 1, 2021

hello,the resolve is to use

const await client.connect('mongodb://localhost:27017');

thanks men, salved my life

Did you use the win os? If true, you can try 127.0.0.1 to replace the ‘localhost’.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught Assertion Error | v0.20.0 · Issue #133 - GitHub
hi, this solved for me import { MongoClient } from "https://deno.land/x/mongo@v0.20.0/mod.ts"; const client = new MongoClient(); await ...
Read more >
error: Uncaught (in promise) AssertionError - Stack Overflow
I found that in the mongo.ts file of the project, there is a line like this: client.connect(Deno.env.get("MONGODB_URI") || "");.
Read more >
assertion-error - npm
Error constructor for test and validation frameworks that implements standardized AssertionError specification.. Latest version: 2.0.0, ...
Read more >
assertion failed: file:/home/jesus/flutter/packages/flutter/lib/src ...
I had this assertion failure happening because I was using a MouseRegion subtree, where the onEnter / onExit handlers were throwing an uncaught...
Read more >
Node.js v19.3.0 Documentation
All errors thrown by the node:assert module will be instances of the AssertionError class. new assert.AssertionError(options) #. Added in: v0.1.21. options < ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found