question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Random connection errors

See original GitHub issue

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 given below:

ConnectTimeoutError: Connect Timeout Error
    at onConnectTimeout (D:\Rakin\Projects\sudobot-v2\node_modules\undici\lib\core\connect.js:131:24)
    at D:\Rakin\Projects\sudobot-v2\node_modules\undici\lib\core\connect.js:78:46
    at Immediate._onImmediate (D:\Rakin\Projects\sudobot-v2\node_modules\undici\lib\core\connect.js:117:33)
    at processImmediate (node:internal/timers:464:21) {
  code: 'UND_ERR_CONNECT_TIMEOUT'
}

Code sample

// client = discord client
// this code might not always fail - for me the error was coming randomly

client.on('interactionCreate', async (interaction) => {
   if (interaction.isChatInputCommand()) {
      // do some stuff like bulk deleting messages or warning users

     await interaction.reply({ content: 'Done' });
   }
});

Package version

v14.2.0

Node.js version

v16.13.0

Operating system

Windows 10

Priority this issue should have

Medium (should be fixed soon)

Which partials do you have configured?

Channel

Which gateway intents are you subscribing to?

Guilds, GuildMembers, GuildBans, GuildEmojisAndStickers, GuildInvites, GuildPresences, GuildMessages, GuildMessageReactions, GuildMessageTyping, DirectMessages, DirectMessageReactions, DirectMessageTyping, MessageContent

I have tested this issue on a development release

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
Larsundsocommented, Aug 19, 2022

having the same issues, but it’s undici acting up, not d.js

0reactions
TheGalacticAcecommented, Dec 21, 2022

Hey, I’m experiencing this issue. How do I fix it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Random connection reset error - Microsoft Community
1) Clear the browser cache and cookies: · 2) Try disabling all extensions to see if this helps: · 3) For Edge, repair...
Read more >
Random connection problems - Super User
My computer fails to open some websites randomly. I recently updated to Windows 8.1 and had everything working for 3-4 weeks. From then...
Read more >
[SOLVED] Internet Randomly Disconnects - Why and How to Fix
There are multiple reasons why your Internet connection randomly disconnects. When it comes to connecting to the Internet via WiFi, ...
Read more >
Been getting random connection errors quite literally every 10 ...
Been getting random connection errors quite literally every 10 minutes or so. Is this a common problem with this game or something?
Read more >
Random Connection Issue - TeamViewer Community
I have one computer that my colleagues need to connect to that will randomly not complete a connection.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found