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.48k stars 3.69k forks source link

Sorry sir i still learning but i can't run the code #3011

Closed MorelChrish closed 6 months ago

MorelChrish commented 6 months ago

Is there an existing issue for this?

Describe the bug

const version = indexHtml.match(/manifest-([\d\.]+).json/)[1]; ^

TypeError: Cannot read properties of null (reading '1') at LocalWebCache.persist (D:\Reguler Ganjil 2021\S6\Cek Chatbot\node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34:69) at D:\Reguler Ganjil 2021\S6\Cek Chatbot\node_modules\whatsapp-web.js\src\Client.js:744:36 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) Node.js v18.18.0

i'm use newest wa version yesterday

though this bug already fixed just use tutorial code

Expected behavior

-

Steps to Reproduce the Bug or Issue

-

Relevant Code

const qrcode = require('qrcode-terminal'); const { Client } = require('whatsapp-web.js'); const client = new Client({

});

client.initialize();

client.on('qr', qr => { qrcode.generate(qr, {small: true}); });

client.on('ready', () => { console.log('Client is ready!'); });

client.on('message_create', message => { if (message.body === '!ping') { // send back "pong" to the chat the message was sent in client.sendMessage(message.from, 'pong'); } });

Browser Type

Google Chrome

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

Node JS 18.18.0 Windows 11 Android wa-web.js i just download at 1 may 2024

Additional context

No response

oceanimagine commented 6 months ago

hello there maybe this link can help you solved your problem https://github.com/pedroslopez/whatsapp-web.js/issues/2885

alechkos commented 6 months ago

2789

2816