whatsapp-web.js
whatsapp-web.js copied to clipboard
After scanning the QRCODE and starting whatsapp, loading completely, it returns the following error.
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.
Node.js v18.14.0
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.
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...
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.
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 });
});
I have the same issue... on latest 1.24.0
https://github.com/wppconnect-team/wa-version/commit/7f959f352158729c6e88dd77cf7d38447d7be713