pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
15.05k stars 3.58k forks source link

Cannot read properties of undefined (reading 'default') #3201

Closed mauroalx closed 1 month ago

mauroalx commented 2 months ago

Is there an existing issue for this?

Describe the bug

After reading QRCODE the log outputs INFO: CONNECTED, so an Error is triggered

0|whaticket-backend | Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'default') 0|whaticket-backend | at pptr://puppeteer_evaluation_script:5:95 0|whaticket-backend | at ExecutionContext._ExecutionContext_evaluate (/home/deploy/whaticket-alpha/whaticket-community/backend/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:229:15) 0|whaticket-backend | at runMicrotasks () 0|whaticket-backend | at processTicksAndRejections (internal/process/task_queues.js:95:5) 0|whaticket-backend | at async ExecutionContext.evaluate (/home/deploy/whaticket-alpha/whaticket-community/backend/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:107:16) 0|whaticket-backend | at async Client.initialize (/home/deploy/whaticket-alpha/whaticket-community/backend/node_modules/whatsapp-web.js/src/Client.js:340:9)

Expected behavior

After status is CONNECTED I should be able to send and receive messages, but the above error is triggered.

Steps to Reproduce the Bug or Issue

  1. Create a new connection
  2. Read QRCODE
  3. Check the log

Relevant Code

No response

Browser Type

Chromium

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

Additional context

No response

Casal0x commented 1 month ago

did you find a possible fix to it? similar issue here from windows and ubuntu.

D:\Development\NodeJS\WhatsAppBot\node_modules\puppeteer-core\lib\cjs\puppeteer\common\ExecutionContext.js:229
        throw new Error('Evaluation failed: ' + (0, util_js_1.getExceptionMessage)(exceptionDetails));
              ^

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'default')
    at pptr://__puppeteer_evaluation_script__:5:95
    at ExecutionContext._ExecutionContext_evaluate (D:\Development\NodeJS\WhatsAppBot\node_modules\puppeteer-core\lib\cjs\puppeteer\common\ExecutionContext.js:229:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ExecutionContext.evaluate (D:\Development\NodeJS\WhatsAppBot\node_modules\puppeteer-core\lib\cjs\puppeteer\common\ExecutionContext.js:107:16)
    at async Client.initialize (D:\Development\NodeJS\WhatsAppBot\node_modules\whatsapp-web.js\src\Client.js:340:9)

Node.js v20.15.1
HichamOujari commented 1 month ago

same here

davidn1x commented 1 month ago

Using Exodus Version Requer Node 18+ 1- npm install github:pedroslopez/whatsapp-web.js#webpack-exodus; 2- If you are using, remove WebCache; 3- delete folders node_modules and wwebjs_auth; 4- npm install; 5- start and go into business

Fix till they patch it. Worked for me, got this solution at discord. Using windows 10 here