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.95k stars 3.55k forks source link

Ready status not achieved on windows even after successful pairing using qr #2439

Closed SKECloud closed 8 months ago

SKECloud commented 1 year ago

Is there an existing issue for this?

Describe the bug

Ready status not achieved on windows even after successful pairing using qr. Tried on both windows server 2016 and windows 11. tried with both pupeteer and plain vanila example on your site. I am presented with the qr and after scanning qr in mobile, it shows sucess in mobile. But on the console there is no action and status not changing to ready...

Expected behavior

I expected that after scanning qr it should log into console ready status.

Steps to Reproduce the Bug or Issue

const qrcode = require('qrcode-terminal');

const { Client } = require('whatsapp-web.js'); const client = new Client();

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

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

client.initialize();

Used this code as it is. got the qr in terminal. scanned the code successfully but reccevived no Client is ready message.

Relevant Code

const qrcode = require('qrcode-terminal');

const { Client } = require('whatsapp-web.js'); const client = new Client();

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

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

client.initialize();

Browser Type

Other (please write in Additional Context)

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

No, I am not using Multi Device

Environment

Windows 2016 or Windows 11 Pro

Additional context

No response

JuanRa012012 commented 1 year ago

Hi, same problem here, I have been trying about 3 hours, but nothing happens..

olirock commented 1 year ago

See this issue: 2433. They made a hotfix.

felipeaz3vedo commented 1 year ago

Same here on linux...

martinascarone commented 1 year ago

Same here on linux...

Im in the same situation

adalbertobrant commented 1 year ago

Same situation I tried the fix #2443 but not working either.

nestoreltuerto commented 1 year ago

Do:

npm r whatsapp-web.js

Open the package.json file on your computer and add:

"whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_8"

Then run:

npm install

Start your whatsapp script again!

capJack29 commented 1 year ago

"whatsapp-web.js": " https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_8 "

in which line is this inserted?

SKECloud commented 1 year ago

Do:

npm r whatsapp-web.js

Open the package.json file on your computer and add:

"whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_8"

Then run:

npm install

Start your whatsapp script again!

Thanks Buddy ! This works perfectly... God Bless You !!!

safarshidayat commented 1 year ago

I'am using this solution and works fine form me..

/src/Client.js Replace const INTRO_IMG_SELECTOR = '[data-testid="intro-md-beta-logo-dark"], [data-testid="intro-md-beta-logo-light"], [data-asset-intro-image-light="true"], [data-asset-intro-image-dark="true"]'; With const INTRO_IMG_SELECTOR = "[data-icon='chat']";

Reference here: https://github.com/pedroslopez/whatsapp-web.js/issues/2433#issuecomment-1689094849

arsyjr commented 1 year ago

I'am using this solution and works fine form me..

/src/Client.js Replace const INTRO_IMG_SELECTOR = '[data-testid="intro-md-beta-logo-dark"], [data-testid="intro-md-beta-logo-light"], [data-asset-intro-image-light="true"], [data-asset-intro-image-dark="true"]'; With const INTRO_IMG_SELECTOR = "[data-icon='chat']";

Reference here: #2433 (comment)

Thankyou! Bisa bang...

Shvan11 commented 1 year ago

The hotfix works! Thank you.

capJack29 commented 1 year ago

Help, I did it, but it doesn't work! package.json file:

{ "name": "whatsapp-web.js", "whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_8", "version": "1.22.1", "description": "Library for interacting with the WhatsApp Web API ", "main": "./index.js", "typings": "./index.d.ts", "scripts": { "test": "mocha tests --recursive --timeout 5000", "test-single": "mocha", "shell": "node --experimental-repl-await ./shell.js", "generate-docs": "node_modules/.bin/jsdoc --configure .jsdoc.json --verbose" }, "repository": { "type": "git", "url": "git+https://github.com/pedroslopez/whatsapp-web.js.git" }, "keywords": [ "whatsapp", "whatsapp-web", "api", "bot", "client", "node" ], "author": "Pedro Lopez", "license": "Apache-2.0", "bugs": { "url": "https://github.com/pedroslopez/whatsapp-web.js/issues" }, "homepage": "https://wwebjs.dev/", "dependencies": { "@pedroslopez/moduleraid": "^5.0.2", "fluent-ffmpeg": "^2.1.2", "jsqr": "^1.3.1", "mime": "^3.0.0", "mysql2": "^3.6.0", "node-fetch": "^2.6.5", "node-webpmux": "^3.1.0", "puppeteer": "^13.0.0", "whatsapp-web.js": "^1.22.1" }, "devDependencies": { "@types/node-fetch": "^2.5.12", "chai": "^4.3.4", "chai-as-promised": "^7.1.1", "dotenv": "^16.0.0", "eslint": "^8.4.1", "eslint-plugin-mocha": "^10.0.3", "jsdoc": "^3.6.4", "jsdoc-baseline": "^0.1.5", "mocha": "^9.0.2", "sinon": "^13.0.1" }, "engines": { "node": ">=12.0.0" }, "optionalDependencies": { "archiver": "^5.3.1", "fs-extra": "^10.1.0", "unzipper": "^0.10.11" } }

joulgs commented 1 year ago

Help, I did it, but it doesn't work! package.json file:

{ "name": "whatsapp-web.js", "whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_8", "version": "1.22.1", "description": "Library for interacting with the WhatsApp Web API ", "main": "./index.js", "typings": "./index.d.ts", "scripts": { "test": "mocha tests --recursive --timeout 5000", "test-single": "mocha", "shell": "node --experimental-repl-await ./shell.js", "generate-docs": "node_modules/.bin/jsdoc --configure .jsdoc.json --verbose" }, "repository": { "type": "git", "url": "git+https://github.com/pedroslopez/whatsapp-web.js.git" }, "keywords": [ "whatsapp", "whatsapp-web", "api", "bot", "client", "node" ], "author": "Pedro Lopez", "license": "Apache-2.0", "bugs": { "url": "https://github.com/pedroslopez/whatsapp-web.js/issues" }, "homepage": "https://wwebjs.dev/", "dependencies": { "@pedroslopez/moduleraid": "^5.0.2", "fluent-ffmpeg": "^2.1.2", "jsqr": "^1.3.1", "mime": "^3.0.0", "mysql2": "^3.6.0", "node-fetch": "^2.6.5", "node-webpmux": "^3.1.0", "puppeteer": "^13.0.0", "whatsapp-web.js": "^1.22.1" }, "devDependencies": { "@types/node-fetch": "^2.5.12", "chai": "^4.3.4", "chai-as-promised": "^7.1.1", "dotenv": "^16.0.0", "eslint": "^8.4.1", "eslint-plugin-mocha": "^10.0.3", "jsdoc": "^3.6.4", "jsdoc-baseline": "^0.1.5", "mocha": "^9.0.2", "sinon": "^13.0.1" }, "engines": { "node": ">=12.0.0" }, "optionalDependencies": { "archiver": "^5.3.1", "fs-extra": "^10.1.0", "unzipper": "^0.10.11" } }

HI @capJack29 , you need do:

run:

npm unistall whatsapp-web.js -S

after, in your package.json file, you add into "dependencies" sector the line: "whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_8",

like:

...
"dependencies": {
...
"whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_8"
}
...

after this, you run : npm install

albanirneves commented 1 year ago

Same here

DLandDS commented 1 year ago

same here

capJack29 commented 1 year ago

Yes! It worked :) Thanks, very much!

Pritraj commented 1 year ago

It stopped working now again, Please Help

039710 commented 1 year ago

It stopped working now again, Please Help yup indeed its stopped working again

johann04 commented 1 year ago

ready event is working for me, but 'message' event is not

alves-Moises commented 1 year ago

thats wordked for me! Thanks a lot!

mrahmadt commented 1 year ago

Do:

npm r whatsapp-web.js

Open the package.json file on your computer and add:

"whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_8"

Then run:

npm install

Start your whatsapp script again!

I tried with hotfix 8 & issue solved

felipeaz3vedo commented 1 year ago

I installed the alpha version and it seems to be working properly (1.22.2-alpha.0).

abdul-qadeer-mern commented 1 year ago

I installed the alpha version and it seems to be working properly (1.22.2-alpha.0).

Thanks, This (1.22.2-alpha.0) worked for me also.

abdul-qadeer-mern commented 1 year ago

I am facing this error, Can anyone help how to overcome this error? err: Error: Protocol error (Runtime.callFunctionOn): Session closed. Most likely the page has been closed. at CDPSession.send (/Users/macbookpro/what/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:218:35)

Daan2022 commented 1 year ago

Instalei a versão alfa e parece estar funcionando corretamente (1.22.2-alpha.0).

Qual é o passo a passo?

ardipermana59 commented 12 months ago

Do:

npm r whatsapp-web.js

Open the package.json file on your computer and add:

"whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_8"

Then run:

npm install

Start your whatsapp script again!

I just wanna say, it works for me. Thank you very much 😊

Awais-cb commented 12 months ago

Do: npm r whatsapp-web.js Open the package.json file on your computer and add: "whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_8" Then run: npm install Start your whatsapp script again!

Thank you so much worked for me i was just thinking when will this fix be merged in main repo

SonuSubhadip commented 12 months ago

Button sending can work in this file "whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_8" ?? Please tell me

areumtecnologia commented 12 months ago

Use: npm r whatsapp-web.js && npm i whatsapp-web.js@1.22.2-alpha.0 --save

SonuSubhadip commented 11 months ago

@areumtecnologia Same Problem Button also seen but not any response Back Test45 . I atteched snap shot please verify.