#Error [SHARDING_READY_DIED]: Shard 0's process exited before its Client became ready.

25 messages · Page 1 of 1 (latest)

lyric scroll
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

devout widget
#

discord.js -> 13.14
node.js -> v18.8

#
class Sigma extends Client {
    constructor() {
        super({
           shards: 2,
           shardCount: 2,
            allowedMentions: {
                parse: ["roles", "users", "everyone"],
                repliedUser: false
            }, //...```
#
const shard = new ShardingManager('./src/structures/bot.js', { 
    token: this.token,
    totalShards: 2
  });  
  shard.spawn().catch((e) => {console.log(e + `...spawn error`)});```
#
        readdirSync("./src/events/Shards/").forEach(file => {
            const event =   (`../events/Shards/${file}`);
            let eventName = file.split(".")[0];
            this.logger.log(`Loading Events Shards ${eventName}`, "event");
            shard.on(eventName, event.bind(null, shard));
        });```
sudden scaffold
#

Why do you have both a ShardingManager and internal sharding settings? They are either-or

#

Remove shards: and shardCount from client options

devout widget
#

same error

#
    at Shard.onDeath (C:\Users\Pro\Documents\GitHub\sigma\node_modules\discord.js\src\sharding\Shard.js:161:16)
    at Object.onceWrapper (node:events:628:26)
    at Shard.emit (node:events:513:28)
    at Shard._handleExit (C:\Users\Pro\Documents\GitHub\sigma\node_modules\discord.js\src\sharding\Shard.js:407:10)
    at ChildProcess.emit (node:events:513:28)
    at ChildProcess._handle.onexit (node:internal/child_process:291:12) {
  [Symbol(code)]: 'SHARDING_READY_DIED'
}```
sudden scaffold
#

Can you show your full Sigma class please?

devout widget
sudden scaffold
#

And what is your bot.js?

devout widget
#

index.js has a simple const client = new Sigma() and client.connect()

sudden scaffold
#

Then your ShardingManager should spawn the index.js, not the bot.js

devout widget
sudden scaffold
#

Then show your index.js

devout widget
#

index.js

const Sigma = require("./src/structures/bot");
const on = require('./website/server');
const client = new Sigma();


on(client);
client.connect();
module.exports = client;```
#

shardit.js

const { ShardingManager } = require('discord.js')
module.exports = {
    shardit: async function(token, shardCount) {

        const shard = new ShardingManager('./src/structures/bot.js', { 
            token: token,
            totalShards: shardCount
          });  


        await shard.spawn().catch((e) => {
            console.log(e + `...spawn error`)
        }); 

        
    }
};```
#

it works perfectly if I host the beta bot

#

but the verified bot with the 490 servers gets errors