whatsapp-web.js icon indicating copy to clipboard operation
whatsapp-web.js copied to clipboard

An error on the 'ready' event (unconfirmed)

Open jeremyandes opened this issue 2 years ago • 6 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

Description:

  • On client ready event, this error shows up and it kills my app.
  • My app works in 3 different WA numbers, but in the 4th doesn't because of this bug.
  • All devices are iOS.

Log:

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'id')
    at Object.<anonymous> (https://web.whatsapp.com/bootstrap_main.44dc3fdf06d9bb8b053d.js:2:103021)
    at Generator.next (<anonymous>)
    at t (https://web.whatsapp.com/vendor1~bootstrap_qr.5922e52928d864c0918c.js:2:66483)
    at s (https://web.whatsapp.com/vendor1~bootstrap_qr.5922e52928d864c0918c.js:2:66694)
    at https://web.whatsapp.com/vendor1~bootstrap_qr.5922e52928d864c0918c.js:2:66753
    at Y (https://web.whatsapp.com/bootstrap_qr.f74b98c729dd38392a5f.js:37:128505)
    at new y (https://web.whatsapp.com/bootstrap_qr.f74b98c729dd38392a5f.js:37:121072)
    at Object.<anonymous> (https://web.whatsapp.com/vendor1~bootstrap_qr.5922e52928d864c0918c.js:2:66634)
    at Object.k (https://web.whatsapp.com/bootstrap_main.44dc3fdf06d9bb8b053d.js:2:105511)
    at Object.t.sendReactionToMsg (https://web.whatsapp.com/bootstrap_main.44dc3fdf06d9bb8b053d.js:2:102647)
    at ExecutionContext._evaluateInternal (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ExecutionContext.evaluate (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
    at async Message.react (/app/node_modules/whatsapp-web.js/src/structures/Message.js:344:9)

Expected behavior

  1. QR code scan.
  2. Auth success.
  3. Client ready.

Steps to Reproduce the Bug or Issue

Same as normal expected behavior.

Relevant Code

No response

Browser Type

Chromium

WhatsApp Account Type

WhatsApp Business

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

  • Environment: Heroku.
  • Phone OS: iOS.
  • Whatsapp-web.js version: 1.17.1
  • Node.js version: 16.16.0

Additional context

No response

jeremyandes avatar Jul 23 '22 16:07 jeremyandes

hi, could i see the code that gave error?

caqlayan avatar Jul 23 '22 18:07 caqlayan

Hi @caqlayan !

client.on('ready', () => {
    console.log('CLIENT is ready!');
});

jeremyandes avatar Jul 23 '22 19:07 jeremyandes

in error it seems like you try to react a message, but in your code it is not integrated. at async Message.react (/app/node_modules/whatsapp-web.js/src/structures/Message.js:344:9)

caqlayan avatar Jul 23 '22 19:07 caqlayan

in error it seems like you try to react a message, but in your code it is not integrated.

at async Message.react (/app/node_modules/whatsapp-web.js/src/structures/Message.js:344:9)

I'm pretty sure that I handle reactions at message event 🤔 And I've 3 different WA numbers working with no issues, as far as I know. This error shows up at ready event.

jeremyandes avatar Jul 24 '22 01:07 jeremyandes

same issue here

xanaxxx avatar Jul 30 '22 22:07 xanaxxx

in error it seems like you try to react a message, but in your code it is not integrated. at async Message.react (/app/node_modules/whatsapp-web.js/src/structures/Message.js:344:9)

I'm pretty sure that I handle reactions at message event 🤔 And I've 3 different WA numbers working with no issues, as far as I know. This error shows up at ready event.

nope, this appears while trying to run message.react

send us your code or something, or even yet remove the ready event and test if it really is the faulty one

purpshell avatar Aug 02 '22 22:08 purpshell