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

Whenever i got QR code and scan it through mobile it throws error, Issue is started happening from 06/28/2024 #3145

Closed bhargavgbtech closed 2 months ago

bhargavgbtech commented 2 months ago

Is there an existing issue for this?

Describe the bug

Whenever I tried to scan the QR Code from the mobile it throws the error

D:\whatsappweb\node_modules\puppeteer-core\lib\cjs\puppeteer\common\ExecutionContext.js:229
        throw new Error('Evaluation failed: ' + (0, util_js_1.getExceptionMessage)(exceptionDetails));
              ^

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'default')
    at pptr://__puppeteer_evaluation_script__:5:95
    at ExecutionContext._ExecutionContext_evaluate (D:\whatsappweb\node_modules\puppeteer-core\lib\cjs\puppeteer\common\ExecutionContext.js:229:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ExecutionContext.evaluate (D:\whatsappweb\node_modules\puppeteer-core\lib\cjs\puppeteer\common\ExecutionContext.js:107:16)
    at async Client.initialize (D:\whatsappweb\node_modules\whatsapp-web.js\src\Client.js:340:9)

Node.js v20.15.0

Expected behavior

till the date 06/28/2024 its working perfectly fine

Steps to Reproduce the Bug or Issue

node index2.js

Relevant Code

const { Client, LocalAuth } = require('whatsapp-web.js');
const qrcode = require('qrcode-terminal');
const path = require("node:path");

const client = new Client({
    authStrategy: new LocalAuth(), // Using LocalAuth to persist the session
    puppeteer: {
        headless: true // Run in headless mode
    },
    webVersionCache: {
        type: 'none'
    }
});

client.on('qr', (qr) => {
    // Generate and scan this code with your phone
    console.log('QR RECEIVED', qr);
    qrcode.generate(qr, { small: true });
});

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

client.on('authenticated', (session) => {
    console.log('AUTHENTICATED', session);
});

client.on('auth_failure', (msg) => {
    console.error('AUTHENTICATION FAILURE', msg);
});

client.on('message', msg => {
    if (msg.body === '!ping') {
        msg.reply('pong');
    }
});

client.initialize();

Browser Type

Chromium

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

Node.js v20.15.0 NPM 10.1.0

Additional context

No response

ferdiaddawy commented 2 months ago

i have the same problem

gp4jeff commented 2 months ago

Hola al ejecutar el comando(esto lo ley como una solución y a muchos le ha resultado)

npm install github:pedroslopez/whatsapp-web.js#webpack-exodus

da este error

root@vmi1916666:/home/jeff2011# npm install github:pedroslopez/whatsapp-web.js#webpack-exodus npm warn using --force Recommended protections disabled. npm error code ENOENT npm error syscall spawn git npm error path git npm error errno -2 npm error enoent An unknown git error occurred npm error enoent This is related to npm not being able to find a file. npm error enoent npm error A complete log of this run can be found in: /root/.npm/_logs/2024-06-29T04_03_02_828Z-debug-0.log root@vmi1916666:/home/jeff2011#

alguien que me ayude?

overloaders commented 2 months ago

Hola al ejecutar el comando(esto lo ley como una solución y a muchos le ha resultado)

npm install github:pedroslopez/whatsapp-web.js#webpack-exodus

da este error

root@vmi1916666:/home/jeff2011# npm install github:pedroslopez/whatsapp-web.js#webpack-exodus npm warn using --force Recommended protections disabled. npm error code ENOENT npm error syscall spawn git npm error path git npm error errno -2 npm error enoent An unknown git error occurred npm error enoent This is related to npm not being able to find a file. npm error enoent npm error A complete log of this run can be found in: /root/.npm/_logs/2024-06-29T04_03_02_828Z-debug-0.log root@vmi1916666:/home/jeff2011#

alguien que me ayude?

install git

https://git-scm.com/downloads

gp4jeff commented 2 months ago

gracias ahí me resulto

ChirayuShah commented 2 months ago

i have the same problem

elasticode-id commented 2 months ago

i have the same problem

alechkos commented 2 months ago

2816