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.05k stars 3.58k forks source link

Cannot read properties of null (reading '1') #2867

Closed yogiigabe closed 5 months ago

yogiigabe commented 5 months ago

Is there an existing issue for this?

Describe the bug

running npm run start:dev, I found bug :

D:\whatsapp-api\node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34 const version = indexHtml.match(/manifest-([\d\.]+).json/)[1]; ^

TypeError: Cannot read properties of null (reading '1') at LocalWebCache.persist (D:\whatsapp-api\node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34:69) at D:\whatsapp-api\node_modules\whatsapp-web.js\src\Client.js:744:36 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v21.7.1

Expected behavior

I want to display the WhatsAppweb qrcode but instead a bug occurs

Steps to Reproduce the Bug or Issue

problem not fix

Relevant Code

No response

Browser Type

Google Chrome

WhatsApp Account Type

WhatsApp Business

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

windows 10

Additional context

No response

rizki5411 commented 5 months ago

Same here

roanhub commented 5 months ago

debes ir a: /home/roanh/oben/node_modules/whatsapp-web.js/src/webCache/LocalWebCache.js:34

y luego en la linea 34 cambiar: const version = indexHtml.match(/manifest-([\d\.]+).json/)[1];

por: const version = indexHtml.match(/manifest.json/)[1];

y se soluciona.

Me estaba pasando el mismo problema, luego de hacer lo de arriba se corrigió el problema.

Captura desde 2024-04-02 23-58-16

alechkos commented 5 months ago

2789