UND_ERR_CONNECT_TIMEOUT

I am getting this error, my bot was working fine a week ago when I was working on it.
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^

ConnectTimeoutError: Connect Timeout Error
at onConnectTimeout (/mnt/g/Documents/BDO/Recruitment Bot/node_modules/undici/lib/core/connect.js:182:24)
at /mnt/g/Documents/BDO/Recruitment Bot/node_modules/undici/lib/core/connect.js:129:46
at Immediate._onImmediate (/mnt/g/Documents/BDO/Recruitment Bot/node_modules/undici/lib/core/connect.js:170:9)
at process.processImmediate (node:internal/timers:471:21) {
code: 'UND_ERR_CONNECT_TIMEOUT'
}
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^

ConnectTimeoutError: Connect Timeout Error
at onConnectTimeout (/mnt/g/Documents/BDO/Recruitment Bot/node_modules/undici/lib/core/connect.js:182:24)
at /mnt/g/Documents/BDO/Recruitment Bot/node_modules/undici/lib/core/connect.js:129:46
at Immediate._onImmediate (/mnt/g/Documents/BDO/Recruitment Bot/node_modules/undici/lib/core/connect.js:170:9)
at process.processImmediate (node:internal/timers:471:21) {
code: 'UND_ERR_CONNECT_TIMEOUT'
}
Even when I remove all my code and just run this, I get this error.
const fs = require('node:fs');
const path = require('node:path');
const { Client, Collection, Events, GatewayIntentBits } = require('discord.js');
const { token } = require('./config.json');

const client = new Client({ intents: [GatewayIntentBits.Guilds] });

client.login("mytokenhere");
const fs = require('node:fs');
const path = require('node:path');
const { Client, Collection, Events, GatewayIntentBits } = require('discord.js');
const { token } = require('./config.json');

const client = new Client({ intents: [GatewayIntentBits.Guilds] });

client.login("mytokenhere");
Obviously my token is my actual token (thought the problem had something to do with my dotenv so then tried config file and just putting my token in index.js, nothing fixed it) Also found this github issue which looks like mine, but should've been resloved about a year ago: https://github.com/discordjs/discord.js/issues/8489
GitHub
Random connection errors · Issue #8489 · discordjs/discord.js
Which package is this bug report for? discord.js Issue description Random connection errors especially when using slash commands. I'm 100% sure my connection is strong enough. The error is give...
3 Replies
d.js toolkit
d.js toolkit15mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
treble/luna
treble/luna15mo ago
Sounds like a network/firewall issue
Six
SixOP15mo ago
yeah I'll mark it as resolved, if I don't run it on WSL it worked
Want results from more Discord servers?
Add your server