-
-
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
Unhandled 'error' event emitted, received [object Object] #10389
Comments
Please provide a reproducible sample! Also, can you try reproducing this on a development version? |
This doesn't happen very frequently, so it will be hard to reproduce. It happens randomly after the bot has been up for a while. Yes, tried on dev version. The issue isn't the actual 520 response error, but the Uncaught exception part. |
+1 on this; it happens to my sharded bot without any repro steps other than waiting and watching the console log. Additionally, instead of
I get both authentication failed and "sharding is required" errors |
Would be useful if you could at least tell us how you're instantiating your client. |
No one in this issue has ever mentioned the ShardingManager. That's probably related. I'll try to investigate this week |
Gotcha, my bad. I'll provide more of my logs for reference. I did some more digging and it looks like this is happening right after a zombie connection is identified Authentication required: Sharding required (despite being sharded): Happy to provide more info whenever you investigate if needed. Thank you! |
I am receiving this same error with
and was throwing when my intents were wrong. |
Your "issue" is most certainly caused by not having an error listener on the manager, looking at your stack trace. As per intents, that is intended to throw an error you cannot catch. The folks in this issue do have an error listener, which makes the hard error unexpected behavior. |
I'm not using the ShardingManager, just internal sharding. Instantiated the client like this:
Not sure if this helps, but the last time this error emitted through This is how it was emitted before, and it would close with a
|
Hey there, as stated in #10392 (comment) - this is an upstream bug, hence why it was weirdly introduced even to |
Does this mean my issue is something entirely separate? So sorry, very tired today 🥲 |
I'm not sure! 520 is normal. The Shard should be catching it, but async_event_emitter was wrongly throwing the error despite a
I'm not sure what the "proper" way of forcing a non-direct dep like that to update is, but for sure wiping your |
Unfortunately, no 😭 I just force removed everything and reinstalled and got this big ol error a few mins in:
Sorry in advance for the formatting of the comment, I don't know why it's not line spacing correctly lol |
Can you run |
We're a bit confused on the stack trace, but for now, that error is only thrown if Discord themselves think something is wrong with your auth token. Please make sure the bot token you are passing in is still valid. |
I double checked, it's the correct token since I just replaced it with a new one this morning; it used all its sessions |
If this helps, I just found these logs that happen directly before each time the unhandled error event emits -
Thanks y'all for looking into this 🥺 |
Which package is this bug report for?
discord.js
Issue description
Getting error
Unhandled 'error' event emitted, received [object Object]
although listening to botherror
andshardError
event. Iv'e gotten this 520 response error before, but it used to always emit to theshardError
event before14.15.3
Code sample
No response
Versions
Issue priority
Medium (should be fixed soon)
Which partials do you have configured?
Channel, GuildMember, Message, Reaction
Which gateway intents are you subscribing to?
Not applicable
I have tested this issue on a development release
No response
The text was updated successfully, but these errors were encountered: