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
Support discord.js
#2077
Comments
Is there any update on
|
@net-tech I think a fix may have just made it into main, I'll check tomorrow and update this issue accordingly |
Update: |
I got the same error with the Winston logging library. It looks like it's a general issue. |
Hey any update on that closer look? Not trying to be a bother, just wondering if there's been any progress. |
I just want to say I am experiencing the same issue bun version: 0.5.8
|
Gonna check on this one later today. There was an issue in our fetch implementation that was causing this but I think it might have been merged into canary already. |
export async function parseResponse(res: Dispatcher.ResponseData): Promise<unknown> {
const header = parseHeader(res.headers['content-type']);
if (header?.startsWith('application/json')) {
return res.body.json();
}
return res.body.arrayBuffer();
} |
Now it managed to succeed, after I downloaded @discordjs/rest package and replace the source code in dist/index.js (res.headers.get('content-type') instead of res.headers['content-type']) it managed to go past client.login! Now the next problem is
Also I just found more res.headers[''] instead of res.headers.get() in the discord.js rest file, after changing everything I also needed to change
to
because one of the headers returned is equal to null. it still however returned Promise.resolve error UPDATE: The error is not in Promise.resolve but rather in import_node_events2.once(this, "ready") after a bit of trials I found out when you use import_node_events2.once(this, "ready", {}) it works. But there are still a lot of errors. |
After I and some guys on the discord server investigated the issue (we still are) we found out that these versions work: 14.9.0: works (normal bun) Anything above 14.9.0 doesn't work, Anything below 14.0.0 requires modified node_modules/discord.js: you need to remove the line For anything above 14.0.0 you should (example below made for 14.9.0) node_modules/@discordjs/rest/dist/index.js: I didn't fully test this, but the bot seems to launch. |
It's not out yet, just wait a couple days and upgrade your version of bun. |
|
Do you have discord? It's more comfortable for me to help you there than on GitHub. |
yep i am in bun server, my discord is GillCoder#7005 |
Still hitting issue with discord.js 😢 |
That stack trace is interesting. It shouldn’t be going to undici through
node_modules and it shouldn’t be going through undici for websockets
either. Hm
…On Sat, Jun 3, 2023 at 5:24 AM Luna ***@***.***> wrote:
Still hitting issue with discord.js 😢
#1987 <#1987>
#2688 (comment)
<#2688 (comment)>
—
Reply to this email directly, view it on GitHub
<#2077 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFNGS724KIPIH365C7QU6LXJMUGZANCNFSM6AAAAAAU4PNSFQ>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
@Jarred-Sumner happy to provide more details here or in the discord. Same username there. |
We've long had requests for
discord.js
support. It doesn't seem too far away now that we've gotundici.Agent
and a workaround for theworker_threads
requirement.Currently it looks like we need the following to finish support for
discord.js
:undici.request
(tracking in Implement someundici
APIs #1987)response.arrayBuffer()
hangs when called more than once (no tracking yet)The text was updated successfully, but these errors were encountered: