whatsapp-api-tutorial
whatsapp-api-tutorial copied to clipboard
TimeoutError: waiting for selector `canvas` failed
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)
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.
Thanks for the reply. I am using version 1.15.2 of whatsapp-web.js This is the latest version, right?
Yes, that is already the latest version. Was you try it on your local machine?
No. I am running it in server. It is happenin when I am trying to scan the qr code.
Wait, let me know which type do you use of whatsapp? Are you using Whatsapp Multi Device Beta?
I am using the older version only. Not Whatsapp Multi-Device Beta,
I mean the version that you use on your phone.
Here is the way to check it
- Go to Settings
- Linked Devices
- See on Multi-Device Beta status (joined or not)
I have not joined Beta.
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 (