-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deno Support #9663
Comments
Dupe of #7065 😄 |
I know, but that issue doesn't specifically mention how Deno has NPM support now and it would be way easier to implement without having to find other 3rd party libraries and packages. |
Apparently Deno1.35 now supports discord.js along with some other NPM packages, however, it seems like After doing some testing, Deno works on the following systems:
Here's a related issue: denoland/deno#19766 |
check #9683 |
Should be closable now- |
Nope, not fixed. 1.35.1's regression breaks compatibility anyway, and any version below 1.35.0 just returns an API error. :( |
Try the |
Here's the error:
|
For now, a mitigation strategy is to |
Noo, I see the issue. |
Aghhhhhhh! Why does it fail with a different error then?! Damn you, Deno and randomly breaking!
EDIT: Or you could just manually push dev, yeah, works too |
Aha, no. It returns the EXACT SAME ERROR on discord.js@14.11.1-dev.1689600799-afa9879.0 |
hm so now the latest version of discord.js (when its published to npm) should fix the issue with Deno 1.35.0 and 1.35.1, right? |
No, it's not fixed at all. 1.35.0 is fixed on |
well then when will we stop having to use @dev? |
Once discord.js makes a new release |
are you sure you're on @dev? doesn't happen to me |
yep, heres my code: import { Client, GatewayIntentBits, Partials } from "npm:discord.js@dev";
import config from "./config.json" assert { type: "json" };
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
],
partials: [
Partials.Channel,
Partials.GuildMember,
Partials.Reaction,
Partials.ThreadMember,
Partials.User,
],
});
client.config = config;
client
.login(config.token)
.then(() => console.log(`🟩 [LOGIN] Client logged in.`))
// .catch((err) => console.error(`🟥 [LOGIN] ${err}`)); err:
Deno 1.35.0, Windows 11 Lite (basically Tiny 11) |
Not sure if W11 Lite is the problem. All I know is stock Windows 11 works fine. |
Can you verify that the latest dev release is using fetch instead of undici for deno? |
well not in my case as you can clearly see undici in the error log, ill check the latest dev version tmr tho |
Deno has pushed a commit to patch the regression in 1.35.1, next Deno release will be able to natively run discord.js. For now, |
For what it's worth, once we release new versions of all modules you also can do that 😄 |
Nope- it's not working for everyone on |
do i close the issue now? i mean its practically fixed from both sides now |
Which application or package is this feature request for?
discord.js
Feature
Deno, which is a Node.js successor, is a very popular runtime for JavaScript and TypeScript, while I know that most people still use Node.js as its the "industry standard" I also think DJS should add Deno support as it would be pretty easy - I'm not sure, I'm not an expert - and Deno also released NPM package support a long time ago, which would further help here.
I'm pretty sure this wouldnt require a new major version but more of a minor release, as its not that big of a thing imo, Deno is pretty close to how Node.js is and it should be pretty easy, I know lots of people also posted issues like this but I'm trying to get more into detail.
Ideal solution or implementation
To fix this I'd recommend trying to either make a new version of DJS on Denos package registery deno.land/x/ and/or adding support for Deno in the existing NPM library.
Alternative solutions or implementations
You could also simply iron out the bugs that Deno is facing with importing "npm:discord.js" and it would be basically kind of the same fix.
Other context
No response
Tasks
The text was updated successfully, but these errors were encountered: