Error [ShardingInProcess]: Shards are still being spawned.
how can I fix this error? (when loading 0 shard)
3 Replies
- 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 OPYou 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 stuffhttps://discord.com/channels/222078108977594368/824410765012238366/995410003798269992
Thanks!