There is some issue with the npm package whatsapp-web.js and after i install and create the new client with localAuth in index.js file it does not work. i have searched the errors about local web cache and other issues with can not read property null and undefined.
still struggling to run this program from many days.
can someone help to run this program?
Expected behavior
error
Steps to Reproduce the Bug or Issue
npm init
npm install whatsapp-web.js
npm install qrcode-terminal
create index.js file with this
i just console.log every message received.
Relevant Code
import pkg from "whatsapp-web.js";
import qrcode from 'qrcode-terminal'
const {LocalAuth, Client} = pkg;
export const Client = new Client({
webVersion: "2.2325.3",
webVersionCache: {
type: "remote",
remotePath: "https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2325.3.html",
},
authStrategy: new LocalAuth({
dataPath:"AuthFolder",
clientId: "client-one"
}),
puppeteer: {
args: ['--no-sandbox', '--disable-setuid-sandbox'],
}
});
Client.on('loading_screen', (percent, message) => {
console.log('LOADING SCREEN', percent, message);
});
Client.on('authenticated', () => {
console.log('AUTHENTICATED');
});
Client.on('auth_failure', msg => {
// Fired if session restore was unsuccessful
console.error('AUTHENTICATION FAILURE', msg);
});
Client.on('ready', () => {
console.log('Bot is getting ready!')
});
Client.on('qr', (qr) => {
// NOTE: This event will not be fired if a session is specified.
qrcode.generate(qr, {small: true})
// console.log('QR RECEIVED', qr);
});
Client.on('message', msg => {
if (msg.body == '!ping') {
msg.reply('pong');
}
console.log(msg)
});
await Client.initialize();
Browser Type
Chromium
WhatsApp Account Type
WhatsApp Business
Does your WhatsApp account have multidevice enabled?
Yes, I am using Multi Device
Environment
OS: [e.g. Mac, Windows, Linux, Docker + Ubuntu 18, etc]
Phone OS: [e.g. Android, iOS]
whatsapp-web.js version [e.g. 1.2.3]
WhatsApp Web version [run await client.getWWebVersion()]:
Node.js Version [e.g. 1.2.3]
Is there an existing issue for this?
Describe the bug
There is some issue with the npm package whatsapp-web.js and after i install and create the new client with localAuth in index.js file it does not work. i have searched the errors about local web cache and other issues with can not read property null and undefined. still struggling to run this program from many days. can someone help to run this program?
Expected behavior
error
Steps to Reproduce the Bug or Issue
Relevant Code
import pkg from "whatsapp-web.js"; import qrcode from 'qrcode-terminal' const {LocalAuth, Client} = pkg;
export const Client = new Client({ webVersion: "2.2325.3", webVersionCache: { type: "remote", remotePath: "https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2325.3.html", }, authStrategy: new LocalAuth({ dataPath:"AuthFolder", clientId: "client-one" }), puppeteer: { args: ['--no-sandbox', '--disable-setuid-sandbox'], } }); Client.on('loading_screen', (percent, message) => { console.log('LOADING SCREEN', percent, message); }); Client.on('authenticated', () => { console.log('AUTHENTICATED'); }); Client.on('auth_failure', msg => { // Fired if session restore was unsuccessful console.error('AUTHENTICATION FAILURE', msg); }); Client.on('ready', () => { console.log('Bot is getting ready!') }); Client.on('qr', (qr) => { // NOTE: This event will not be fired if a session is specified. qrcode.generate(qr, {small: true}) // console.log('QR RECEIVED', qr); }); Client.on('message', msg => { if (msg.body == '!ping') { msg.reply('pong'); } console.log(msg) }); await Client.initialize();
Browser Type
Chromium
WhatsApp Account Type
WhatsApp Business
Does your WhatsApp account have multidevice enabled?
Yes, I am using Multi Device
Environment
OS: [e.g. Mac, Windows, Linux, Docker + Ubuntu 18, etc] Phone OS: [e.g. Android, iOS] whatsapp-web.js version [e.g. 1.2.3] WhatsApp Web version [run await client.getWWebVersion()]: Node.js Version [e.g. 1.2.3]
Additional context
No response