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

Client is not ready! #2498

Closed felipesyss closed 1 year ago

felipesyss commented 1 year ago

Is there an existing issue for this?

Describe the bug

After reading the QR CODE, it appears on WhatsApp as an active device, but the client is not connected. No response is received, and continues asking to read the QR CODE.

Expected behavior

I hope the customer connects after reading the QR CODE.

Steps to Reproduce the Bug or Issue

  1. npm start
  2. Scan QR code
  3. Client is not ready

Relevant Code

No response

Browser Type

Google Chrome

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

No, I am not using Multi Device

Environment

Additional context

No response

MauritzFunke commented 1 year ago

It has to do with the checks if the client needs to be authenticated.

Add the change the code in line 179 to the following code if your client is already authenticated. Note that this is only a temporary fix and is very bad and should never be used in any serious application:

        const needAuthentication = false;
        await page.waitForNavigation({waitUntil: 'networkidle2'});
Simeone-Holanda commented 1 year ago

This error is very strange, it started happening yesterday, but only on the VPS, on my machine it connects normally, I really don't know what this could be. It was happening before, I updated the version and resolved it, then it happened again and as always only on the VPS, on my always connected machine, could it be something to do with the IP? for example my vps is in Germany, but my machine is in Brazil

BiaTrixie commented 1 year ago

This error is very strange, it started happening yesterday, but only on the VPS, on my machine it connects normally, I really don't know what this could be. It was happening before, I updated the version and resolved it, then it happened again and as always only on the VPS, on my always connected machine, could it be something to do with the IP? for example my vps is in Germany, but my machine is in Brazil

It may be because you already have an active session so it doesn't give an error, use a cloud code with an active session and it works normally but locally it's giving this error

Simeone-Holanda commented 1 year ago

@BiaTrixie I'm going to disconnect everything and clear the caches of the locations to see if it works, any success stories I'll report here

felipesyss commented 1 year ago

I updated my Client.js based on the branch:

https://github.com/brunox64/whatsapp-web.js/blob/patch-1/src/Client.js

That resolved it.

It should merge soon, I believe.

BiaTrixie commented 1 year ago

Atualizei meu Client.js com base no branch:

https://github.com/brunox64/whatsapp-web.js/blob/patch-1/src/Client.js

Isso resolveu.

Deve se fundir em breve, acredito.

Deu certo aqui, obrigada!

erleibiazzio commented 11 months ago

I updated my Client.js based on the branch:

https://github.com/brunox64/whatsapp-web.js/blob/patch-1/src/Client.js

That resolved it.

It should merge soon, I believe.

This solved my problem