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

Not Able to get QR code #2825

Open
tls-jil opened this issue Nov 15, 2024 · 25 comments
Open

Not Able to get QR code #2825

tls-jil opened this issue Nov 15, 2024 · 25 comments
Labels
bug Something isn't working needs triage Needs avaliation

Comments

@tls-jil
Copy link

tls-jil commented Nov 15, 2024

Description

when I request to get the QR code and try to get QR code it's return noting even it's not log the QR code I have set logQR : true previously it's work for me and I haven't change any code on the server can you please help me on that

here is the sample code

venom
.create(
{
session: "<SESSION_ID>",
headless: true,
autoClose: 60000,
logQR: true,
debug: true,
},
(base64Qr) => {
console.log('base64Qr', base64Qr)
//
},
(statusSession, session) => {
//return isLogged || notLogged || browserClose || qrReadSuccess || qrReadFail || autocloseCalled || desconnectedMobile || deleteToken || chatsAvailable || deviceNotConnected || serverWssNotConnected || noOpenBrowser || initBrowser || openBrowser || connectBrowserWs || initWhatsapp || erroPageWhatsapp || successPageWhatsapp || waitForLogin || waitChat || successChat
// //Create session wss return "serverClose" case server for close
// console.log("Session name: ", session);
}
)
.then(async (client) => {
console.log(">>", client);
})
.catch((erro) => {
});

Environment

  • Venom version(s): v5.2.0
  • Browser: Chrome 131.0.6778.69
  • OS: Ubuntu 22.04
  • Node version: v18.17.0
@tls-jil tls-jil added bug Something isn't working needs triage Needs avaliation labels Nov 15, 2024
@tls-jil
Copy link
Author

tls-jil commented Nov 15, 2024

The same code on my other system worked fine on that system Environment is as below

Environment

  • Venom version(s): v5.2.0
  • Browser: Chrome 108.0.5359.124
  • OS: Ubuntu 20.04
  • Node version: v18.17.1

Please help me if any one have idea how to fix that

@BrunoPignatari
Copy link

hit tlj-jil!

How did you download your Chrome version?

@BrunoPignatari
Copy link

So, if in the creation object of the venon instance you set the browser to open (headless: false,) you can log in. Now when you try through the terminal it doesn't open the qrcode and keeps trying to generate it.

@mayronraifurmr
Copy link

Deixei o headless: false e percebi que ao abrir o navegador controlado por um sistema a página do whatsapp abre mas não carrega o QRCODE, depois abri a página manualmente normal e carregou....

Não sei como resolver esse problema, acredito que seja algum bloqueio do whatsapp

@ghayman
Copy link
Contributor

ghayman commented Nov 15, 2024

Please confirm that installing the latest version from here

npm install github:orkestral/venom#master

is not working.
A fix has been made for this in the repo but we are unable to push it to npmjs.com at this time

@BrunoPignatari
Copy link

install with npm install github:orkestral/venom#master
and :

import venom from 'venom-bot';
^^^^^^

SyntaxError: Cannot use import statement outside a module
at internalCompileFunction (node:internal/vm:76:18)
at wrapSafe (node:internal/modules/cjs/loader:1283:20)
at Module._compile (node:internal/modules/cjs/loader:1328:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
at Module.load (node:internal/modules/cjs/loader:1203:32)
at Module._load (node:internal/modules/cjs/loader:1019:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
at node:internal/main/run_main_module:28:49

Node.js v18.20.5
brunopignatari@MBP-de-Bruno jarviiii %

@ghayman
Copy link
Contributor

ghayman commented Nov 15, 2024

Depends on your app, it should be one of these

// import { create } from 'venom-bot';
or
// const venom = require('venom-bot');

@mayronraifurmr
Copy link

Você resolveu o seu problema? Aqui continua o problema....

@mayronraifurmr
Copy link

Captura de Tela 2024-11-16 às 10 50 32

@antoniovalenzuela
Copy link

antoniovalenzuela commented Nov 16, 2024

issue QR if use
npm i --save venom-bot

works with
npm install github:orkestral/venom#master

@mayronraifurmr
Copy link

Hello everyone!

I've tried several procedures to solve the QR Code issue in Venom, but I haven't been successful yet. Here are the steps I've already taken:

Installed the latest version from GitHub using the following command:

"npm install github:orkestral/venom#master"

The installation completed successfully, but the issue still persists.
Cleaned the dependencies environment:

Deleted the node_modules folder and the package-lock.json file.
Reinstalled all dependencies with:

"npm install"

Even so, nothing changed.

@antoniovalenzuela
Copy link

antoniovalenzuela commented Nov 17, 2024

Hello everyone!

I've tried several procedures to solve the QR Code issue in Venom, but I haven't been successful yet. Here are the steps I've already taken:

Installed the latest version from GitHub using the following command:

"npm install github:orkestral/venom#master"

The installation completed successfully, but the issue still persists.
Cleaned the dependencies environment:

Deleted the node_modules folder and the package-lock.json file.
Reinstalled all dependencies with:

"npm install"

Even so, nothing changed.

You tried node upgrade?

I upgrade to v20.18.0 in Debian.

Too delete tokens folder.

@Zefo94
Copy link

Zefo94 commented Nov 17, 2024

I have the same problem I need help to solve this

@tls-jil
Copy link
Author

tls-jil commented Nov 18, 2024

Description

when I request to get the QR code and try to get QR code it's return noting even it's not log the QR code I have set logQR : true previously it's work for me and I haven't change any code on the server can you please help me on that

here is the sample code

venom .create( { session: "<SESSION_ID>", headless: true, autoClose: 60000, logQR: true, debug: true, }, (base64Qr) => { console.log('base64Qr', base64Qr) // }, (statusSession, session) => { //return isLogged || notLogged || browserClose || qrReadSuccess || qrReadFail || autocloseCalled || desconnectedMobile || deleteToken || chatsAvailable || deviceNotConnected || serverWssNotConnected || noOpenBrowser || initBrowser || openBrowser || connectBrowserWs || initWhatsapp || erroPageWhatsapp || successPageWhatsapp || waitForLogin || waitChat || successChat // //Create session wss return "serverClose" case server for close // console.log("Session name: ", session); } ) .then(async (client) => { console.log(">>", client); }) .catch((erro) => { });

Environment

  • Venom version(s): v5.2.0
  • Browser: Chrome 131.0.6778.69
  • OS: Ubuntu 22.04
  • Node version: v18.17.0

what about linking the device with an 8-digit Code instead of a QR code ???

does anyone have any idea how to implement that?

I use browserInstance to handle and get an 8-digit code by manually selecting the link,input field and button, this works for me but today on 18th November 2024 it's not return me the 8-digit code

if anyone had any ideas please help me

@mayronraifurmr
Copy link

Hello everyone!

I've followed all the steps I previously mentioned, but unfortunately, the QR Code issue persists. I've ensured that I'm using the latest version of Venom from the GitHub repository and have also cleaned my dependencies and reinstalled them, but the problem remains unresolved.

Is there any additional procedure or specific configuration that I might be missing? Any guidance would be greatly appreciated. Thank you in advance!

@caetano157
Copy link

npm install github:orkestral/venom#master

try: npm uninstall venom-bot
and: npm install github:orkestral/venom#master

@Arieumarella
Copy link

Arieumarella commented Nov 19, 2024

uninstall venom-bot and run npm install github:orkestral/venom#master
like this #2822

@Lpiana
Copy link

Lpiana commented Nov 19, 2024

Guys, today, 11/19/2024, I managed to solve the issue...
The WhatsApp page has changed, which caused the "normal" versions of Venom to fail. I tried the approach of opening the page and logging in from there, but I ran into issues due to the company's antivirus. However, this is the logic I followed:

install:
npm install open

in code of server.js:

import open from 'open';

...

const main = async () => {
  try {
    const venombotInstance = VenomBot.getInstance();
    const venombot = await venombotInstance.init({
      session: `'qqq',`
      headless: false, // Alterado para false para visualizar o navegador
      useChrome: true,
    });

    // Abra o WhatsApp Web no navegador padrão
    await open('https://web.whatsapp.com');

    console.log('Sessão qqq inicializada com sucesso. Sistema Online');

    // Restante do seu código...
  } catch (error) {
    console.error('Erro ao inicializar o VenomBot:', error);
  }
};

main();

But, I wasn't able to test this option... But I'm sharing it to help

In the end, I followed what Arieumarella said:
uninstall venom-bot and run npm install github:orkestral/venom#master <<<<------- THIS WORKS!!!!

@mayronraifurmr
Copy link

Unfortunately, I’m still facing the issue. I ran npm uninstall venom-bot and then npm install github:orkestral/venom#master, but it didn’t resolve the problem.

#2822

I noticed that in the issue linked above, the QR Code was generated but venom couldn't find the image. In my case, the QR Code isn’t even generated in the browser controlled by venom.

@ghayman
Copy link
Contributor

ghayman commented Nov 19, 2024

@mayronraifurmr that is a very different problem....
I have seen WhatsApp take up to 20-30 seconds recently to product the QR code.

Could you do one more test....
Start up your Chrome browser (must be Chrome) manually.
Goto https://web.whatsapp.com
Do you get a QR code?

@tls-jil
Copy link
Author

tls-jil commented Dec 3, 2024

Hello, everyone
Is anyone able to get the QR code ??

OR

My suggestion is to replace the QR code with an 8-digit code as a new method of WhatsApp login.

@allanalcantara
Copy link

allanalcantara commented Dec 12, 2024

Hello, everyone Is anyone able to get the QR code ??

OR

My suggestion is to replace the QR code with an 8-digit code as a new method of WhatsApp login.

change to translate in portuguese.
Sim, o qrcode é gerado nos logs da execução, conforme exemplo abaixo:

const venom = require('venom-bot');
venom
.create(
'sessionPage', // Session name
(base64Qr, asciiQR) => {
console.log('QR Code:', asciiQR);
},
(statusSession, session) => {
console.log('Status Session:', statusSession);
console.log('Session name:', session);
},
{
headless: 'new',
devtools: true,
logQR: true,
disableSpins: true
},
// BrowserInstance
(browser, waPage) => {
console.log('Browser PID:', browser.process().pid);
waPage.screenshot({ path: 'screenshot.png' });
}
)
.then((client) => start(client))
.catch((error) => console.error('Error starting Venom:', error));

function start(client) {
console.log('Hello');
}

shows this:

Captura de tela 2024-12-12 134647

@tls-jil
Copy link
Author

tls-jil commented Dec 13, 2024

Hello, everyone Is anyone able to get the QR code ??
OR
My suggestion is to replace the QR code with an 8-digit code as a new method of WhatsApp login.

change to translate in portuguese. Sim, o qrcode é gerado nos logs da execução, conforme exemplo abaixo:

const venom = require('venom-bot');
venom
.create(
'sessionPage', // Session name
(base64Qr, asciiQR) => {
console.log('QR Code:', asciiQR);
},
(statusSession, session) => {
console.log('Status Session:', statusSession);
console.log('Session name:', session);
},
{
headless: 'new',
devtools: true,
logQR: true,
disableSpins: true
},
// BrowserInstance
(browser, waPage) => {
console.log('Browser PID:', browser.process().pid);
waPage.screenshot({ path: 'screenshot.png' });
}
)
.then((client) => start(client))
.catch((error) => console.error('Error starting Venom:', error));
function start(client) {
console.log('Hello');
}

shows this:

Captura de tela 2024-12-12 134647

hey @allanalcantara

I have do the same code as you provide but still not able to get Code in terminal or in base64 even i try with headless false,

here i shared the screenshot of the code

Group 9

@allanalcantara
Copy link

Does not display the code in the log? if headless option is active, browser hidden and show logs
try use:
headless: 'new',
useChrome: true,
logQR: true,
browserArgs: ['--no-sandbox', '--disable-setuid-sandbox'],

something is wrong, Have you updated to the latest version?

2024-12-13_22-35

@tls-jil
Copy link
Author

tls-jil commented Dec 16, 2024

Does not display the code in the log? if headless option is active, browser hidden and show logs try use: headless: 'new', useChrome: true, logQR: true, browserArgs: ['--no-sandbox', '--disable-setuid-sandbox'],

something is wrong, Have you updated to the latest version?

2024-12-13_22-35

Hey @allanalcantara

i use same code as you but still get the same error

i use venom : "venom-bot": "github:orkestral/venom",

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Needs avaliation
Projects
None yet
Development

No branches or pull requests

10 participants