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

Mútiplos bugs na nova versão #2900

Closed wldevlojaz closed 7 months ago

wldevlojaz commented 7 months ago

Is there an existing issue for this?

Describe the bug

Varios erros na nova versão

Erro no arquivo: /src/webCache/LocaWebCache.js // extract version from index (e.g. manifest-2.2206.9.json -> 2.2206.9) const version = indexHtml.match(/manifest-([\d\.]+).json/)[1]; << Erro: não é possível obter index 1 de undefined. if(!version) return;

Corrigido o erro acima com: const versionCheck = indexHtml.match(/manifest-([\d\.]+).json/); const version = versioCheck ? versionCheck[0] : null;

Estourando outro erro: Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'WidFactory') Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'default')

Tentivas: Downgrade da versão: 1.23.0 para 1.19.5 Resultado: eventos de escuta (listener) não disparam somente o do QRCode / loading_screen

Expected behavior

QR Code Read > Log ("Bot Ready) after listener .on("ready") is triggered

Steps to Reproduce the Bug or Issue

Replique o exemplo: node ./node_modules/whatsapp-web.js/example.js Receba: TypeError: Cannot read properties of null (reading '1') at LocalWebCache.persist (C:\Users\WL.DEV\Desktop\Worker\WHATSAPP_API\node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34:69) at C:\Users\WL.DEV\Desktop\Worker\WHATSAPP_API\node_modules\whatsapp-web.js\src\Client.js:744:36 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Relevant Code

No response

Browser Type

Chromium

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

OS: Windows 11 Phone OS: Android whatsapp-web.js version: 1.23.0 WhatsApp Web version [run await client.getWWebVersion()]: (TypeError: Cannot read properties of null (reading 'evaluate')) ?? Node.js Version: 20.11.1

Additional context

No response

wldevlojaz commented 7 months ago

Fixed: private wwebVersion = '2.2410.1'

new instance options: webVersionCache: { type: 'remote', remotePath: https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/${this.wwebVersion}.html, },

whatsapp-web.js version: 1.23.0

lucaszest commented 7 months ago

+1

DiegoFelipe commented 7 months ago

I have the same issue how to fix?

andersondeoliveiramachado commented 7 months ago

I have the same issue how to fix?

const wwebVersion = '2.2410.1'; const clientBot = new Client({ authStrategy: new LocalAuth(), puppeteer: { headless: true }, webVersionCache: { type: 'remote', remotePath: https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/${wwebVersion}.html, }, })

brunofa23 commented 7 months ago

TypeError: Cannot read properties of null (reading '1') I'm also experiencing the same error, I've tried using the webVersionCache but it didn't work.

if anyone can help.