pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
15.53k stars 3.7k forks source link

throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails)); #2576

Closed edergames29 closed 11 months ago

edergames29 commented 1 year ago

Is there an existing issue for this?

Describe the bug

C:\Users\Lasanha\Documents\Node JS\node_modules\whatsapp-web.js\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:221 throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails)); ^

Error: Evaluation failed: Error: Unexpected null or undefined: Parent message missing message secret at t.default (https://web.whatsapp.com/:2:398) at t.default (https://web.whatsapp.com/:2:675) at https://web.whatsapp.com/app.1b6002989bf96f16e110.js:93:736159 at Generator.next () at t (https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:2:66483) at s (https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:2:66694) at https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:2:66753 at new Promise () at https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:2:66634 at t.getMsgJson (https://web.whatsapp.com/app.1b6002989bf96f16e110.js:93:735692) at ExecutionContext._evaluateInternal (C:\Users\Lasanha\Documents\Node JS\node_modules\whatsapp-web.js\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\Lasanha\Documents\Node JS\node_modules\whatsapp-web.js\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:110:16) at async Message.react (C:\Users\Lasanha\Documents\Node JS\node_modules\whatsapp-web.js\src\structures\Message.js:362:9)

Node.js v20.4.0

Expected behavior

send message for groups.

Steps to Reproduce the Bug or Issue

Input msg texto = comand.arguments to sendMessage

{ arguments: 'comunidade de divulgação_\n' + '\n' + '🟠canal de atualizações do bot\n' + '⬇️\n' + ' https://whatsapp.com/channel/0029va6eva8e50uq0g3oi80m' }

Relevant Code

else if (comand.comando == 'global') { let texto = 'Digie o texto' if(comand.arguments){ texto = comand.arguments } const antiMsgAutomatica = ['120363040269914819'] const todosChats = await client.getChats() FUNCOESV.CONFIGURACAO.bot_ligado=false let contagem = 0 if(numero_de_quem_mandou == FUNCOESV.CONFIGURACAO.superuser){ for(c of todosChats){ if(c.isGroup && !antiMsgAutomatica.includes(c.id.user)){ c.sendMessage(_Olá: ${c.name}_\n\n${texto}).catch(e=>{ console.log('Erro') }) console.log(Mensagem global encaminhada para: ${c.name} ${c.id.user}) contagem+=1 } } FUNCOESV.CONFIGURACAO.bot_ligado=true msg.react('⚙️') }else{ msg.react('🚫') }

}

Browser Type

Google Chrome

WhatsApp Account Type

WhatsApp Business

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

Windows 11 Phone: Android 13 Node.js v20.4.0

Additional context

The command worked perfectly two weeks ago but I was using the normal WhatsApp account.

edergames29 commented 1 year ago

I went back to normal WhatsApp and the command started working again.