#Sharding Eval not working, throwing random reference error

6 messages · Page 1 of 1 (latest)

versed steppe
#

Hey,

Trying to eval:

socket.on("message", async data => {
  console.log("WEBHOOK RECEIVED " + data)
  await Manager.shards.get(0).eval(async client => {
    await client.startActivation(data);
  }, {context: data});
})``

but getting



Error [ReferenceError]: data is not defined
    at eval (eval at _eval (/home/bots/Bot/node_modules/discord.js/src/client/Client.js:470:12), <anonymous>:2:34)
    at eval (eval at _eval (/home/bots/Bot/node_modules/discord.js/src/client/Client.js:470:12), <anonymous>:3:5)
    at Client._eval (/home/bots/Bot/node_modules/discord.js/src/client/Client.js:470:12)
    at ShardClientUtil._handleMessage (/home/bots/Bot/node_modules/discord.js/src/sharding/ShardClientUtil.js:194:82)
    at process.emit (node:events:390:28)
    at emit (node:internal/child_process:917:12)
    at processTicksAndRejections (node:internal/process/task_queues:84:21)

Any ideas?

rustic cipherBOT
#

• 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.

versed steppe
#

data is a string & is definitely defined

#

is it somehow not possible to pass strings into eval?

versed steppe
#

got it nvm

#

context