Search code examples
javascriptnode.jswhatsapp

Whatsapp-web js doesn't fire ready event


Whatsapp-web js doesn’t fire ready event and other only fire Qr event. I alos scan and authenticate the whatsapp correctly. but not working ready event.

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

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

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

client.initialize();

Solution

  • This was fixed my issue

    npm r whatsapp-web.js

    set this version in package.json "whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_7"

    npm install