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
14.53k stars 3.46k forks source link

client.logout() Exception #2442

Open Adi1231234 opened 10 months ago

Adi1231234 commented 10 months ago

Is there an existing issue for this?

Describe the bug

When I use client.logout() with authStrategy: LocalAuth with specific dataPath and clientId. I get this error:

(node:12684) UnhandledPromiseRejectionWarning: Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'AppState')
    at __puppeteer_evaluation_script__:2:26
    at ExecutionContext._evaluateInternal (C:\Users\whataspp-transfer\whatsapp-web-use\software\whatsapp-web-software\node_modules\whatsapp-web.js\node_modules\puppeteer\src\common\ExecutionContext.ts:273:13)
versions:

Expected behavior

The logout function should logout and not throw exception

Steps to Reproduce the Bug or Issue

Use client.logout() with authStrategy: LocalAuth with specific dataPath and clientId.

whatsapp-web.js: 1.22.1 puppeteer: 21.1.0

Browser Type

Google Chrome

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

Windows 10

gamafolk commented 10 months ago

Same problem here

joaoVCNN commented 10 months ago

@Adi1231234 can you assign this issue for me ?

ayushmourya commented 10 months ago

@Adi1231234 I have created a PR for the same, Please review

Luskan777 commented 3 weeks ago

Same problem here