vasani-arpit / WBOT

A simple Web based BOT for WhatsApp™ in NodeJS 😜. Working as of 📅 Feb 4th, 2024
Other
977 stars 313 forks source link

TypeError: Cannot read properties of null (reading '1') #366

Closed webhype closed 3 months ago

webhype commented 3 months ago

Describe the bug

██╗    ██╗██████╗  ██████╗ ████████╗
██║    ██║██╔══██╗██╔═══██╗╚══██╔══╝
██║ █╗ ██║██████╔╝██║   ██║   ██║
██║███╗██║██╔══██╗██║   ██║   ██║
╚███╔███╔╝██████╔╝╚██████╔╝   ██║
 ╚══╝╚══╝ ╚═════╝  ╚═════╝    ╚═╝

v0.56.0
✔ Downloading chromium ... done!
⣻ Launching browser
/var/node/WBOT/node_modules/whatsapp-web.js/src/webCache/LocalWebCache.js:34
        const version = indexHtml.match(/manifest-([\d\\.]+)\.json/)[1];
                                                                    ^

TypeError: Cannot read properties of null (reading '1')
    at LocalWebCache.persist (/var/node/WBOT/node_modules/whatsapp-web.js/src/webCache/LocalWebCache.js:34:69)
    at /var/node/WBOT/node_modules/whatsapp-web.js/src/Client.js:728:36
    at runNextTicks (node:internal/process/task_queues:60:5)
    at listOnTimeout (node:internal/timers:540:9)
    at process.processTimers (node:internal/timers:514:7)

Node.js v20.12.0

To Reproduce Steps to reproduce the behavior:

  1. cloned github
  2. ./setup/setup.sh
  3. xvfb-run node src/index.js

Expected behavior That it start without errors. Honestly not sure what to expect because the readme.md doesn't show or say what comes next. 🙂

It's also completely unclear to me how this bot will "log into" my WhatsApp. I assume it launches Chromium and shows the WhatsApp QR code at some point. But what if I run this from a Linux computer that has NO graphical user interface (like the droplets that you suggested)? This part is not explained at all.

App information (please complete the following information):

Additional context 1) Since I don't have a graphical desktop, I deviated from the instructions and started with "headless": true, however with false it throws the same error 2) Would like to know how this is expected to connect to / authenticate with the WhatsApp on my phone (not explained or shown at all) 3) ./setup/setup.sh doesn't seem to package it into the executable so I ran the source code version but they should both work, right?

vasani-arpit commented 3 months ago

Resolved in latest version. https://github.com/vasani-arpit/WBOT/releases