ole113
ole113
DIAdiscord.js - Imagine an app
Created by ole113 on 9/20/2023 in #djs-questions
Shard 0's process exited before its Client became ready
My bot was working fine and then I restarted it to make a small non breaking change and from now on even after reverting the change I get this error message:
Node.js v18.12.1
[INFO]: Shard [0] died
[INFO]: Spawned shard [0]
[INFO]: Error in [0]
[ERR]: Error [ShardingReadyDied]: Shard 0's process exited before its Client became ready.
[INFO]: Shard [0] died
[INFO]: Error in [0]
[ERR]: Error [ShardingReadyDied]: Shard 0's process exited before its Client became ready.
/Users/alex/Documents/Programming/node_modules/discord.js/src/sharding/Shard.js:201
this.worker.removeListener('exit', this._exitListener);
^

TypeError: Cannot read properties of null (reading 'removeListener')
at Shard.kill (/Users/alex/Documents/Programming/node_modules/discord.js/src/sharding/Shard.js:201:19)
at Shard.respawn (/Users/alex/Documents/Programming/node_modules/discord.js/src/sharding/Shard.js:223:10)
at Shard.<anonymous> (/Users/alex/Documents/Programming/src/shard.js:26:15)
at Shard.emit (node:events:513:28)
at /Users/alex/Documents/Programming/node_modules/discord.js/src/sharding/Shard.js:447:56
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Node.js v18.12.1
[INFO]: Shard [0] died
[INFO]: Spawned shard [0]
[INFO]: Error in [0]
[ERR]: Error [ShardingReadyDied]: Shard 0's process exited before its Client became ready.
[INFO]: Shard [0] died
[INFO]: Error in [0]
[ERR]: Error [ShardingReadyDied]: Shard 0's process exited before its Client became ready.
/Users/alex/Documents/Programming/node_modules/discord.js/src/sharding/Shard.js:201
this.worker.removeListener('exit', this._exitListener);
^

TypeError: Cannot read properties of null (reading 'removeListener')
at Shard.kill (/Users/alex/Documents/Programming/node_modules/discord.js/src/sharding/Shard.js:201:19)
at Shard.respawn (/Users/alex/Documents/Programming/node_modules/discord.js/src/sharding/Shard.js:223:10)
at Shard.<anonymous> (/Users/alex/Documents/Programming/src/shard.js:26:15)
at Shard.emit (node:events:513:28)
at /Users/alex/Documents/Programming/node_modules/discord.js/src/sharding/Shard.js:447:56
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
I've tried uninstalling and reinstalling discord.js but to no avail. I've had this issue before on a EC2 instance that didn't have enough RAM to run a sharded bot but it would time out on the shard that the instance ran out of memory on but it would never immediately timeout like this. I've tried running it on my Mac and Windows desktop which both have 16gb of RAM and both give the same error message. Where do I even begin with debugging/solving this? Thanks.
7 replies