Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qr Code Scanner - Error #3020

Closed
1 task done
manuonda opened this issue May 10, 2024 · 1 comment
Closed
1 task done

Qr Code Scanner - Error #3020

manuonda opened this issue May 10, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@manuonda
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When scanning qr code and waiting for response, error occurs:

whatsapp-web.js/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 (/home/manuonda/projects/javascript-ts-project/ia/asistente/node_modules/whatsapp-web.js/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 (/home/manuonda/projects/javascript-ts-project/ia/asistente/node_modules/whatsapp-web.js/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:107:16)
at async Client.initialize (/home/manuonda/projects/javascript-ts-project/ia/asistente/node_modules/whatsapp-web.js/src/Client.js:340:9)

Expected behavior

As a user I was expecting to show in the console that the client connected but it was showing an error in the output.

Steps to Reproduce the Bug or Issue

1 - Install dependencys
my file package.json is :
{ "dependencies": { "@whiskeysockets/baileys": "^6.7.2", "puppeteer": "^22.8.0", "qrcode-terminal": "^0.12.0", "whatsapp-web.js": "^1.23.1-alpha.6" }, "name": "asistente", "version": "1.0.0", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "node index" }, "keywords": [], "author": "", "license": "ISC", "description": "" }

2 - Create file main.js with the next code :
`

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

const client = new Client();

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

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

client.initialize();
`

Relevant Code

This code is simple in the file main.js :

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

const client = new Client();

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

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

client.initialize();

Browser Type

Google Chrome

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

No, I am not using Multi Device

Environment

OS:  Ubuntu 22
Phone OS: Android 
whatsapp-web.js : ^1.23.1-alpha.6
WhatsApp Web version: Whastapp Messenger 2.24.9.78
Node.js Version : v18.19.0

Additional context

I try with node version 20 and result is the same.

@manuonda manuonda added the bug Something isn't working label May 10, 2024
@alechkos
Copy link
Collaborator

#2789
#2816

@alechkos alechkos closed this as not planned Won't fix, can't repro, duplicate, stale May 10, 2024
Repository owner locked and limited conversation to collaborators May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants