Whimsical error shows up when I run a file
I'm trying to make a discord bot with Deno and d.js but for some reasons I get this error
10 Replies
The error message you're seeing is related to the way Deno handles module imports. According to the documentation, Deno does not support bare specifiers like
@discordjs/util
. Instead, you should use a full URL or a relative path.
In your case, it seems like the @discordjs/builders
package is trying to import the @discordjs/util
package using a bare specifier, which is not supported in Deno.
If you're using code both with Deno and Node.js, the node:
scheme will work in both runtimes and itβs recommended to update to them for your Node.js code. However, this might not be applicable in your case if the discord.js library does not support Deno.
You might want to check if there's a version of the discord.js library that's compatible with Deno, or consider using a different library that is compatible with Deno. π¦Alright, what should I do then?
π¦π I'm glad I was able to help!
For npm imports, I think you need to prefix with
npm:
so it would look like
import {things} from "npm:@discordjs/util"
BRO
WTF
vs code made a genious move
that's so stupid
issue is gone after i fixed it
thank you for response anyway
lol - if it's hosted on NPM, use the
npm:
prefix. Auto-complete, intellisense, and chatbots are great, trust but always verify.Hi team; how do i enable intellisence for npm module sub directories. I have a npm module and i want to be able to access sub folders within that module e.g "npm:myMod/sub/file.ts"