D
Deno

help

Deno and `npm:mongodb` problem with `node:`?

Aabi6/13/2023
❯ deno check --reload main.ts
error: Relative import path "net" not prefixed with / or ./ or ../ and not in import map from "file:///Users/.../Library/Caches/deno/npm/registry.npmjs.org/mongodb/5.6.0/mongodb.d.ts"
If you want to use a built-in Node module, add a "node:" prefix (ex. "node:net").
at file:///Users/.../Library/Caches/deno/npm/registry.npmjs.org/mongodb/5.6.0/mongodb.d.ts:29:29
❯ deno check --reload main.ts
error: Relative import path "net" not prefixed with / or ./ or ../ and not in import map from "file:///Users/.../Library/Caches/deno/npm/registry.npmjs.org/mongodb/5.6.0/mongodb.d.ts"
If you want to use a built-in Node module, add a "node:" prefix (ex. "node:net").
at file:///Users/.../Library/Caches/deno/npm/registry.npmjs.org/mongodb/5.6.0/mongodb.d.ts:29:29
I'm simply importing stuff from npm:mongodb@5.6.0, why doesn't Deno understand this thing now?
❯ deno --version
deno 1.34.2 (release, aarch64-apple-darwin)
v8 11.5.150.2
typescript 5.0.4
❯ deno --version
deno 1.34.2 (release, aarch64-apple-darwin)
v8 11.5.150.2
typescript 5.0.4
I have also tried this with the same problem: deno cache --reload --no-lock --unstable main.ts No, actually I get almost the same problem, just a different import: error: Relative import path "events" not prefixed with / or ./ or ../ and not in import map from "file:///Users/.../Library/Caches/deno/npm/registry.npmjs.org/mongodb/5.6.0/mongodb.d.ts" I can import npm:mongodb just fine in Deno REPL, but not in my project... Never mind, I found the culprit: import { Sort } from "../../../../../../Library/Caches/deno/npm/registry.npmjs.org/mongodb/5.6.0/mongodb.d.ts"; 🤦‍♂️

Looking for more? Join the community!

Recommended Posts
DiscordJS "Error: Not implemented: ClientRequest.options.createConnection"```ts import { GatewayDispatchEvents, GatewayIntentBits, InteractionType, MessageFlags, Client } froUsing Superagent in Deno?Has anyone managed to make Superagent work nicely in Deno? ``` _ { type: "error", message: "BroOak – ctx.assert with custom response headersAm I doing this wrong? No extra custom headers are being set in the response as far as I can see in npm:undici doesn't workhttps://github.com/denoland/deno/issues/16710 Marked as resolved by this issue but does not work in Abusing prototype CryptoKey in `node:crypto`Is there any way that I can set the prototype of an object to specifically `CryptoKey` as defined byUncaught (in promise) TypeError: cannot read headers: request closedWhat is this? How to fix it?Async OP that returns value instead of promiseIn `deno_runtime` is possible to have async op that returns the resolved value instead of promise? KFresh Logging MiddlewareHow would you go about writing a duration logger? Using 2 middlewares, I assumed they would behave VS-Code auto import local modulesHey is there a way to enable some sort of auto import for local modules/files in VS-Code? Currently In memory Deno KvHi there, I am exploring with [Deno Kv](https://deno.com/deploy/docs/kv) and it looks great! But myDeno Language Server Issue - Attempting to Use KV in Existing ProjectHi! I'm attempting to create a branch of an existing project (utilizing Fresh) and add KV as an expeTwitter APIIs there a easy way to fetch Tweets using Twitter API or something else? (since they put their API c