venom: Venom doesn't send messages (gadd called without an id attr (id))

Description

When i try to send a text message (to unkown or a contact) it fails.

Environment

  • Venom version(s): 4.0.6
  • Browser: Chrome Version 98.0.4758.102
  • OS: Windows 10 x64
  • Node version: Node v16.13.2

Steps to Reproduce

  1. Enable multi-device
  2. Send a message to a number (like 55999123456@c.us)
  3. It will crash.

Log Output

Error: Evaluation failed: Error: gadd called without an id attr (id)
    at W.gadd (https://web.whatsapp.com/bootstrap_qr.faeb72dc2a3a441a20d1.js:65:420665)
    at https://web.whatsapp.com/bootstrap_qr.faeb72dc2a3a441a20d1.js:65:249166
    at Generator.next (<anonymous>)
    at t (https://web.whatsapp.com/vendor1~bootstrap_qr.947b18aebaee33ade8af.js:2:63784)
    at s (https://web.whatsapp.com/vendor1~bootstrap_qr.947b18aebaee33ade8af.js:2:63995)
    at https://web.whatsapp.com/vendor1~bootstrap_qr.947b18aebaee33ade8af.js:2:64054
    at Y (https://web.whatsapp.com/bootstrap_qr.faeb72dc2a3a441a20d1.js:5:243670)
    at new y (https://web.whatsapp.com/bootstrap_qr.faeb72dc2a3a441a20d1.js:5:236237)
    at https://web.whatsapp.com/vendor1~bootstrap_qr.947b18aebaee33ade8af.js:2:63935
    at W._findAndParse (https://web.whatsapp.com/bootstrap_qr.faeb72dc2a3a441a20d1.js:65:249899)
    at ExecutionContext._evaluateInternal

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 5
  • Comments: 27 (4 by maintainers)

Most upvoted comments

Gentlemen, I took a test and it seems that messages can only be sent to contacts who are in your conversation list.

In other words, it is necessary for the recipient to contact you first by sending a message.

try:

let chats = await client.getAllChats(); if(chats.findIndex(c => c.id._serialized === message.from) > -1) { //send message }

Maybe this should be reopened. Using WAPI directly, on WhatsApp legacy (without multi-device), the function sendExist fails with this error. Screenshot from 2022-03-08 20-29-52

Checking the calls, sendExist calls checkNumberStatus that in turn is calling WAPI.isBeta without await.

I noticed that the problem is with the phone number.

If you send without the ninth digit it works. Example. 5562985800000@c.us does not work 556285800000@c.us so it works

Even then messages can only be sent to contacts who are in your conversation list

So far all I’ve tested has worked

Facing the same problem: If it helps, there’s a similar solution called wppconnect that has the same interfaces/API as venom and could perhaps work for you: https://www.npmjs.com/package/@wppconnect-team/wppconnect The latest version is working for me Thanks to both venom and wppconnect creators! 🙏

I can confirm what @michaelloliveira has said, I no longer see the error when I started the conversation.

For me, it seems that updating whatsapp-web to version 2.2206.5 with venom running broke it, after that update “sendtext” started to send only one message and then crash. I had to completely remove my application and install it again, then Chromium was already running the new version of whatsapp-web, and everything start it to work normally.

In further tests I was able to make “sendtext” stop crash, cleaning my app’s APPDATA folder.

I have no idea if this has something to do with your problems, but maybe it will help someone or even help to address the issue.