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

After scanning the QRCODE and starting whatsapp, loading completely, it returns the following error.

Open DevShop1251 opened this issue 1 year ago • 6 comments

Describe the bug

C:\Users\55419\Downloads\bots\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:221 throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails));
^

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'isNewsletter') at Object.t.canReplyMsg (https://web.whatsapp.com/app.39064ec0dec361638b30.js:72:689860) at Object.window.WWebJS.sendMessage (puppeteer_evaluation_script:36:41) at puppeteer_evaluation_script:10:45 at ExecutionContext._evaluateInternal (C:\Users\55419\Downloads\bots\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:221:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async ExecutionContext.evaluate (C:\Users\55419\Downloads\bots\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:110:16) at async Client.sendMessage (C:\Users\55419\Downloads\bots\src\Client.js:686:28) at async Client. (C:\Users\55419\Downloads\bots\example.js:55:9)

Node.js v18.14.0

DevShop1251 avatar Mar 22 '23 20:03 DevShop1251

I solve this error in the console by updating whatsapp-web.js, I recommend you try both options 1 - run npm update whatsapp-web.js 2 - Delete the folder node_modules and reinstall.

Ayperoz avatar Mar 27 '23 15:03 Ayperoz

I solve this error in the console by updating whatsapp-web.js, I recommend you try both options 1 - run npm update whatsapp-web.js 2 - Delete the folder node_modules and reinstall.

It didn't work either way...

DevShop1251 avatar Mar 27 '23 19:03 DevShop1251

I solve this error in the console by updating whatsapp-web.js, I recommend you try both options 1 - run npm update whatsapp-web.js 2 - Delete the folder node_modules and reinstall.

It didn't work either way...

Try to uninstall and install the package:

npm uninstall whatsapp-web.js
npm install whatsapp-web.js

I believe the issue here is that the install link from the first reference in "whatsapp-web" Google search points to [email protected]. Make sure to take a look at the latest versions.

erlete avatar Apr 02 '23 17:04 erlete

For me, the bug was in calling the processAttachments method. Changed the order of the parameters.

Credits to https://github.com/vilsonei, that fix the bug.

Working here:

  var mc = new Store.MediaCollection(chat);
  mc.processAttachments([{ file: mediaBlob }, 1], 1, chat).then(() => {
    var media = mc._models[0]
    media.sendToChat(chat, { caption: caption });
  });

marcosdemelo avatar Sep 22 '23 19:09 marcosdemelo

I have the same issue... on latest 1.24.0

maelp avatar Jun 29 '24 06:06 maelp

https://github.com/wppconnect-team/wa-version/commit/7f959f352158729c6e88dd77cf7d38447d7be713

vinibgoulart avatar Jun 29 '24 13:06 vinibgoulart