Sharding error

Someone with sharding experience My bot got this error over the night
Unhandled promise rejection: Error [ShardingReadyDied]: Shard 0's process exited before its Client became ready.
at Shard.onDeath (/home/container/Bot1/node_modules/discord.js/src/sharding/Shard.js:178:16)
at Object.onceWrapper (node:events:633:26)
at Shard.emit (node:events:518:28)
at Shard._handleExit (/home/container/Bot1/node_modules/discord.js/src/sharding/Shard.js:439:10)
at ChildProcess.emit (node:events:518:28)
at ChildProcess._handle.onexit (node:internal/child_process:294:12) {
code: 'ShardingReadyDied'
}
Unhandled promise rejection: Error [ShardingReadyDied]: Shard 0's process exited before its Client became ready.
at Shard.onDeath (/home/container/Bot1/node_modules/discord.js/src/sharding/Shard.js:178:16)
at Object.onceWrapper (node:events:633:26)
at Shard.emit (node:events:518:28)
at Shard._handleExit (/home/container/Bot1/node_modules/discord.js/src/sharding/Shard.js:439:10)
at ChildProcess.emit (node:events:518:28)
at ChildProcess._handle.onexit (node:internal/child_process:294:12) {
code: 'ShardingReadyDied'
}
it then tried to respawn itself but crashed again, i'm geussing it took too long to spawn :shrug:
Firebase initialized.
Firebase already initialized. Skipping initialization.
Firebase already initialized. Skipping initialization.
Connected to the database!
Unhandled promise rejection: Error [ShardingReadyDied]: Shard 0's process exited before its Client became ready.
at Shard.onDeath (/home/container/Bot1/node_modules/discord.js/src/sharding/Shard.js:178:16)
at Object.onceWrapper (node:events:633:26)
at Shard.emit (node:events:518:28)
at Shard._handleExit (/home/container/Bot1/node_modules/discord.js/src/sharding/Shard.js:439:10)
at ChildProcess.emit (node:events:518:28)
at ChildProcess._handle.onexit (node:internal/child_process:294:12) {
code: 'ShardingReadyDied'
}
Firebase initialized.
Firebase already initialized. Skipping initialization.
Firebase already initialized. Skipping initialization.
Connected to the database!
Unhandled promise rejection: Error [ShardingReadyDied]: Shard 0's process exited before its Client became ready.
at Shard.onDeath (/home/container/Bot1/node_modules/discord.js/src/sharding/Shard.js:178:16)
at Object.onceWrapper (node:events:633:26)
at Shard.emit (node:events:518:28)
at Shard._handleExit (/home/container/Bot1/node_modules/discord.js/src/sharding/Shard.js:439:10)
at ChildProcess.emit (node:events:518:28)
at ChildProcess._handle.onexit (node:internal/child_process:294:12) {
code: 'ShardingReadyDied'
}
It continued to spew out the first error message for around i'm guessing 5 minutes before the server restarted itself due to the errors (and the bot worked fine after that). Anyone know a fix to this? I've looked around and found someone fixing this with increasing the spawn time. If anyone has any better idea i'd love to know
setTimeout(() => {
manager.spawn();
}, 60000);
setTimeout(() => {
manager.spawn();
}, 60000);
version: "discord.js": "^14.13.0",
1 Reply
d.js toolkit
d.js toolkit4w 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!

Did you find this page helpful?