pranavms13 / whatsapp-node-api

A Simple NodeJS API Wrapper for WhatsApp
Other
471 stars 184 forks source link

After Scan Qr puppeteer showing error and server automatically froce quit #48

Open azartheen opened 2 years ago

azartheen commented 2 years ago

puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:217 throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails)); ^

Error: Evaluation failed: TypeError: Cannot read property 'serialize' of undefined at puppeteer_evaluation_script:2:38 at ExecutionContext._evaluateInternal (C:\Users\Administrator\Downloads\Whatsapp_API\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:217:19) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async ExecutionContext.evaluate (C:\Users\Administrator\Downloads\Whatsapp_API\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:106:16) at async Client.initialize (C:\Users\Administrator\Downloads\Whatsapp_API\node_modules\whatsapp-web.js\src\Client.js:184:42)

any idea why it is happening.. or else I did the wrong method???

@pranavms13 please give a cmt on this

ishrarg commented 2 years ago

I am also facing the same issue after scanning QR Code

achalag1 commented 2 years ago

I am also facing same issue..

ishrarg commented 2 years ago

I got the solution. Do two things for this.

  1. Change package.json set version "whatsapp-web.js": "latest"
  2. remove package-lock.json file from node app folder
  3. Reinstall node package
  4. Enjoy

Thanks Usman Max for the help. @max-programming

achalag1 commented 2 years ago

Getting this error Now

lastqr/60last.qr generated /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 (/var/www/html/WhatsappCode/node_modules/whatsapp-web.js/src/Client.js:143:28) at runMicrotasks () at processTicksAndRejections (node:internal/process/task_queues:96:5)

whatsapp-node-api@0.0.3 start