orkestral / venom

Venom is a high-performance system developed with JavaScript to create a bot for WhatsApp, support for creating any interaction, such as customer service, media sending, sentence recognition based on artificial intelligence and all types of design architecture for WhatsApp.
https://orkestral.io
Apache License 2.0
6.13k stars 1.21k forks source link

TypeError: Cannot read property 'Socket' of undefined #1523

Closed ujjawalchauhan13 closed 2 years ago

ujjawalchauhan13 commented 2 years ago

Description

Whenever I scan the QR code, and right before I run it, I get the Socket undefined bug

Environment

Steps to Reproduce

  1. Getting this error after scanning QR code

Log Output


(node:21743) UnhandledPromiseRejectionWarning: Error: Evaluation failed: TypeError: Cannot read property 'Socket' of undefined
    at __puppeteer_evaluation_script__:3:48
    at ExecutionContext._evaluateInternal (/home/ec2-user/skillbee-whatsappNode/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async ExecutionContext.evaluate (/home/ec2-user/skillbee-whatsappNode/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:21743) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:21743) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
jrrcdev commented 2 years ago

Update:

{ id: "State", conditions: module => module.Socket && module.Socket.takeover ? module : null }

jamesxt94 commented 2 years ago

Same error on method: getNumberProfile

Evaluation failed: TypeError: Cannot read properties of undefined (reading 'Socket')
    at Object.window.WAPI.window.WAPI._serializeMeObj (/path/to/node_modules/.pnpm/venom-bot@4.0.6/node_modules/venom-bot/dist/lib/wapi/wapi.js:1:37635)
    at Object.window.WAPI.window.WAPI.getNumberProfile (/path/to/node_modules/.pnpm/venom-bot@4.0.6/node_modules/venom-bot/dist/lib/wapi/wapi.js:1:70457)
LeonardoGarciah commented 2 years ago

Same error on method: getConnectionState

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'Socket')
    at __puppeteer_evaluation_script__:3:48
    at ExecutionContext._evaluateInternal (C:\Users\leona\Desktop\zapper\chatbot-promo-whatsapp\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:221:19)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async ExecutionContext.evaluate (C:\Users\leona\Desktop\zapper\chatbot-promo-whatsapp\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:110:16)
AlexsandroZanella2 commented 2 years ago

Same error in getConnectionState.

Versions: 4.0.5 and 4.0.6 Node 12, 14 and 16 OS: All Windows after 7


    at __puppeteer_evaluation_script__:3:48
    at ExecutionContext._evaluateInternal (C:\HOSWPP\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:221:19)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ExecutionContext.evaluate (C:\HOSWPP\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:110:16)```