orkestral / venom

Venom is a high-performance system developed with JavaScript to create a bot for WhatsApp, support for creating any interaction, such as customer service, media sending, sentence recognition based on artificial intelligence and all types of design architecture for WhatsApp.
https://orkestral.io
Apache License 2.0
6k stars 1.16k forks source link

4.0.0 sendLinkPreview throws error: Unexpected null or undefined: BUNDLE #1258

Closed RickGroenewegen closed 2 years ago

RickGroenewegen commented 2 years ago

Description

Everything appears to be working again after the 4.0.0 update. However I can no longer send a preview link with 'sendPreviewLink'. It throws an error: Unexpected null or undefined: BUNDLE

Environment

Steps to Reproduce

Call the following code:

client.sendLinkPreview('000000000000@c.us','https://www.google.com','test')

Log Output

/pathToMyApp/node_modules/venom-bot/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:217
            throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails));
                  ^

Error: Evaluation failed: Error: Unexpected null or undefined: BUNDLE
    at t.default (https://web.whatsapp.com/bootstrap_qr.ccb090b3a46e05558abd.js:57:342778)
    at Object.t.get (https://web.whatsapp.com/bootstrap_qr.ccb090b3a46e05558abd.js:57:371606)
    at Function.encrypt (https://web.whatsapp.com/bootstrap_main.27243f942bd0093c9e84.js:5:6882)
    at t.default.<anonymous> (https://web.whatsapp.com/bootstrap_main.27243f942bd0093c9e84.js:2:53596)
    at t.default.write (https://web.whatsapp.com/bootstrap_qr.ccb090b3a46e05558abd.js:2:390139)
    at Object.<anonymous> (https://web.whatsapp.com/bootstrap_main.27243f942bd0093c9e84.js:2:38783)
    at Generator.next (<anonymous>)
    at t (https://web.whatsapp.com/vendor1~bootstrap_qr.d4ef2d214939fc06cd93.js:2:63784)
    at s (https://web.whatsapp.com/vendor1~bootstrap_qr.d4ef2d214939fc06cd93.js:2:63995)
    at https://web.whatsapp.com/vendor1~bootstrap_qr.d4ef2d214939fc06cd93.js:2:64054
    at ExecutionContext._evaluateInternal (/pathToMyApp/node_modules/venom-bot/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:217:19)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ExecutionContext.evaluate (/pathToMyApp/node_modules/venom-bot/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:106:16)

Sending a normal text with client.sendText works fine. Sending a link seems to crash the app

tinyCoder32 commented 2 years ago

Confirmed here, besides other functions in the Wap object returning the same error.

mikelustosa commented 2 years ago

up

orkestral commented 2 years ago

fixed in version 4.0.2

RickGroenewegen commented 2 years ago

Is not fixed for me in 4.02. Still the same issue as described above.

I've removed node_modules and reinstalled everything and cleared the token folder to start with a clean session but that doesn't seem to help

RickGroenewegen commented 2 years ago

I've created a new project with a simple script to reproduce the error:

var venom = require('venom-bot');

var groupID = '000000000000@c.us';

venom.create('venom_test').then((client) => start(client)).catch((err) => {
  console.log(err);
});

var start = function(client) {
    client.sendLinkPreview(groupID,'https://www.google.com','This is a test').then((result) => {
        console.log(result);
    }).catch((err) => {
        console.log(err);
    });
}
239626 commented 2 years ago

Hello,

if you are using MD beta then you can't send link previews, it is stated at whatsapp beta disclaimer

wernerpj1 commented 8 months ago

Trying sending links and stays loading never send someone can help? I've injected wapi.js now when trying sending link writing in the chat