open-wa / wa-automate-nodejs

💬 🤖 The most reliable tool for chatbots with advanced features. Be sure to 🌟 this repository for updates!
https://docs.openwa.dev/
Other
3.11k stars 588 forks source link

QR-Code not generating #2346

Closed almottier closed 2 years ago

almottier commented 2 years ago

Are you using the latest version of the library?

Are you using Multi-device?

Current Behavior

wa.create({
    sessionId: "JULIETTE_TRACKER",
    multiDevice: true, //required to enable multiDevice support
    authTimeout: 60, //wait only 60 seconds to get a connection with the host account device
    blockCrashLogs: true,
    disableSpins: true,
    headless: true,
    hostNotificationLang: 'fr-fr',
    logConsole: false,
    popup: true,
    useChrome: true,
    qrTimeout: 0, //0 means it will wait forever for you to scan the qr code
  }).then(client => start(client));

  function start(client) {
    client.getAllGroups().then(groups => {
      console.log(groups);
    });
  }
$  node app.js                             
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                   ┃
┃   @open-wa/wa-automate                                                                            ┃
┃    💬 🤖 The most reliable NodeJS whatsapp library for chatbots with advanced features.           ┃
┃   Version: 4.25.1                                                                                 ┃
┃   Check out the latest changes: https://github.com/open-wa/wa-automate-nodejs#latest-changes      ┃
┃                                                                                                   ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
You can also authenticate the session at: http://localhost:7000
- Starting
- Version: 4.25.1
- Initializing WA
- Launching Browser
- Setting Up Page
- Loading session data
- No session data file found for session : JULIETTE_TRACKER
- No session data detected. Opting in for MD.
- Make sure to keep the session alive for at least 5 minutes after scanning the QR code before trying to restart a session!!
- Navigating to WA
- Page loaded but something may have gone wrong: 37ms
- Browser Launched
- Please delete the ./_IGNORE_JULIETTE_TRACKER folder and any related data.json files and try again. It is highly suggested to set useChrome: true also.
/Users/alex/dev/marinetraffic/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:513
            const timeoutError = new Errors_js_1.TimeoutError(`waiting for ${options.title} failed: timeout ${options.timeout}ms exceeded`);
                                 ^

TimeoutError: waiting for function failed: timeout 30000ms exceeded
    at new WaitTask (/Users/alex/dev/marinetraffic/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:513:34)
    at DOMWorld.waitForFunction (/Users/alex/dev/marinetraffic/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:468:26)
    at Frame.waitForFunction (/Users/alex/dev/marinetraffic/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:909:32)
    at Page.waitForFunction (/Users/alex/dev/marinetraffic/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:2433:33)
    at Object.<anonymous> (/Users/alex/dev/marinetraffic/node_modules/@open-wa/wa-automate/dist/controllers/initializer.js:194:26)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/alex/dev/marinetraffic/node_modules/@open-wa/wa-automate/dist/controllers/initializer.js:24:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Node.js v17.0.1

Expected Behavior

No response

Steps To Reproduce

No response

Mode

My own code

create() code

No response

DEBUG INFO

{
  "WA_VERSION": "2.2147.14",
  "WA_AUTOMATE_VERSION": "4.25.1",
  "BROWSER_VERSION": "HeadlessChrome/93.0.4577.0",
  "START_TS": 1639051005722
}

Environment

- OS: macOS Monterey
- Node: 17.0.1
- npm:

Screenshots

Screenshot 2021-12-09 at 13 07 45

Anything else?

No response

ghost commented 2 years ago

I also receive this warning today, sometimes during startup (before logging in) and always after restart, as if it is no longer logged in.

smashah commented 2 years ago

@almottier please use headless: false and screen record the web session then share it here

smashah commented 2 years ago

Delete ./_IGNORE_JULIETTE_TRACKER and try again

almottier commented 2 years ago

I tried rm -rf ./_IGNORE_JULIETTE_TRACKER but it doesn't fix it.

with headless: false :

Screenshot 2021-12-10 at 02 12 59
smashah commented 2 years ago

yeah it looks like you're getting tos blocked.

Update your chrome: I am testing with HeadlessChrome/96.0.4664.93 and change your sessoin ID from JULIETTE_TRACKER to something else.

almottier commented 2 years ago

Hello, my Chrome is already the latest version. I am running the ARM64 build on an Apple M1 with Monterey.

image

smashah commented 2 years ago

@almottier I'm also on M1 (Pro). Hard to pinpoint the issue here. Can you try this

> npx @open-wa/wa-automate --use-chrome --disable-spins --debug --headful --multi-device

and then respond with the logs

powermx commented 2 years ago

@almottier I'm also on M1 (Pro). Hard to pinpoint the issue here. Can you try this

> npx @open-wa/wa-automate --use-chrome --disable-spins --debug --headful --multi-device

and then respond with the logs

This is Mine, after update :

/root/Bot/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:175 throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails)); ^

Error: Evaluation failed: ReferenceError: getQrPng is not defined at puppeteer_evaluation_script:1:1 at ExecutionContext._evaluateInternal (/root/Bot/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:175:23) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async ExecutionContext.evaluate (/root/Bot/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)

smashah commented 2 years ago

please show all of your logs not just the error

smashah commented 2 years ago

2355

smashah commented 2 years ago

@almottier can you try with the latest version please

almottier commented 2 years ago

@smashah it is working now, thanks. You may close this issue.