whatsapp-api-tutorial icon indicating copy to clipboard operation
whatsapp-api-tutorial copied to clipboard

TimeoutError: waiting for selector `canvas` failed

Open nazaltk opened this issue 2 years ago • 10 comments

Automatically stops the app by showing the below error. Can you please help me to understand this exception?

/rbd/pnpm-volume/40dc75c6-9879-4a1a-875d-d84e1f257f79/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 selector canvas failed: timeout 45000ms exceeded at new WaitTask (/rbd/pnpm-volume/40dc75c6-9879-4a1a-875d-d84e1f257f79/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:513:34) at DOMWorld.waitForSelectorInPage (/rbd/pnpm-volume/40dc75c6-9879-4a1a-875d-d84e1f257f79/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:424:26) at Object.internalHandler.waitFor (/rbd/pnpm-volume/40dc75c6-9879-4a1a-875d-d84e1f257f79/node_modules/puppeteer/lib/cjs/puppeteer/common/QueryHandler.js:31:77) at DOMWorld.waitForSelector (/rbd/pnpm-volume/40dc75c6-9879-4a1a-875d-d84e1f257f79/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:317:29) at Frame.waitForSelector (/rbd/pnpm-volume/40dc75c6-9879-4a1a-875d-d84e1f257f79/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:841:51) at Page.waitForSelector (/rbd/pnpm-volume/40dc75c6-9879-4a1a-875d-d84e1f257f79/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:2313:33) at Timeout.getQrCode [as _onTimeout] (/rbd/pnpm-volume/40dc75c6-9879-4a1a-875d-d84e1f257f79/node_modules/whatsapp-web.js/src/Client.js:143:28) at processTicksAndRejections (node:internal/process/task_queues:96:5)

nazaltk avatar Dec 04 '21 05:12 nazaltk

Some errors may happened with old version of whatsapp-web.js, so I recommend to always to use the latest version.

It is because Whatsapp makes regularly a change.

ngekoding avatar Dec 04 '21 05:12 ngekoding

Thanks for the reply. I am using version 1.15.2 of whatsapp-web.js This is the latest version, right? image

nazaltk avatar Dec 04 '21 05:12 nazaltk

Yes, that is already the latest version. Was you try it on your local machine?

ngekoding avatar Dec 04 '21 05:12 ngekoding

No. I am running it in server. It is happenin when I am trying to scan the qr code.

nazaltk avatar Dec 04 '21 05:12 nazaltk

Wait, let me know which type do you use of whatsapp? Are you using Whatsapp Multi Device Beta?

ngekoding avatar Dec 04 '21 06:12 ngekoding

I am using the older version only. Not Whatsapp Multi-Device Beta,

nazaltk avatar Dec 04 '21 06:12 nazaltk

I mean the version that you use on your phone.

ngekoding avatar Dec 04 '21 07:12 ngekoding

Here is the way to check it

  1. Go to Settings
  2. Linked Devices
  3. See on Multi-Device Beta status (joined or not)

Multi Device Beta Joined

ngekoding avatar Dec 04 '21 08:12 ngekoding

I have not joined Beta.

nazaltk avatar Dec 04 '21 09:12 nazaltk

I am Facing Same Issue

/var/www/html/WhatsappCode/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 selector canvas failed: timeout 45000ms exceeded at new WaitTask (/var/www/html/WhatsappCode/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:513:34) at DOMWorld.waitForSelectorInPage (/var/www/html/WhatsappCode/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:424:26) at Object.internalHandler.waitFor (/var/www/html/WhatsappCode/node_modules/puppeteer/lib/cjs/puppeteer/common/QueryHandler.js:31:77) at DOMWorld.waitForSelector (/var/www/html/WhatsappCode/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:317:29) at Frame.waitForSelector (/var/www/html/WhatsappCode/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:841:51) at Page.waitForSelector (/var/www/html/WhatsappCode/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:2313:33) at Timeout.getQrCode [as _onTimeout] (/var/www/html/WhatsappCode/node_modules/whatsapp-web.js/src/Client.js:147:28) at runMicrotasks () at processTicksAndRejections (node:internal/process/task_queues:96:5)

achalag1 avatar Dec 31 '21 06:12 achalag1