Error [ShardingInProcess]: Shards are still being spawned.

how can I fix this error? (when loading 0 shard)
Error [ShardingInProcess]: Shards are still being spawned.
at ShardingManager._performOnShards (C:\Users\WORK\Desktop\asagi-assistant-develop\node_modules\discord.js\src\sharding\ShardingManager.js:301:29)
at ShardingManager.fetchClientValues (C:\Users\WORK\Desktop\asagi-assistant-develop\node_modules\discord.js\src\sharding\ShardingManager.js:281:17)
at Shard._handleMessage (C:\Users\WORK\Desktop\asagi-assistant-develop\node_modules\discord.js\src\sharding\Shard.js:391:22)
at ChildProcess.emit (node:events:513:28)
at emit (node:internal/child_process:937:14)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
Error [ShardingInProcess]: Shards are still being spawned.
at ShardingManager._performOnShards (C:\Users\WORK\Desktop\asagi-assistant-develop\node_modules\discord.js\src\sharding\ShardingManager.js:301:29)
at ShardingManager.fetchClientValues (C:\Users\WORK\Desktop\asagi-assistant-develop\node_modules\discord.js\src\sharding\ShardingManager.js:281:17)
at Shard._handleMessage (C:\Users\WORK\Desktop\asagi-assistant-develop\node_modules\discord.js\src\sharding\Shard.js:391:22)
at ChildProcess.emit (node:events:513:28)
at emit (node:internal/child_process:937:14)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
No description
No description
3 Replies
d.js toolkit
d.js toolkit12mo 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
Harnes
Harnes12mo ago
You need to wait to every shard spawn and log in
The way I do it is attach a listener to each shard‘s ready event and add their id to a Set. When the Set‘s size reaches the count of shards I send an 'allShardsReady' message to all shards. Then they know they can start doing sharding stuff
https://discord.com/channels/222078108977594368/824410765012238366/995410003798269992
vlad vollar
vlad vollarOP12mo ago
Thanks!
Want results from more Discord servers?
Add your server