open-wa / wa-automate-nodejs

💬 🤖 The most reliable tool for chatbots with advanced features. Be sure to 🌟 this repository for updates!
https://docs.openwa.dev/
Other
3.15k stars 600 forks source link

sending files Fails after latest update #2868

Closed aymenitc closed 2 years ago

aymenitc commented 2 years ago

Are you using the latest version of the library?

What type of session are you experiencing this issue on?

Multi-device and I have set multiDevice to true in my config OR am using the --multi-device flag

What type of host account are you experiencing this issue on?

Personal account (normal)

Mode

My own code

Current Behavior

I get this error when using sendFile, sendFileFromUrl, sendAudio, and sendPtt it was fine today until I update open-wa

the error:

Caught exception:  Error: Evaluation failed: ReferenceError: id is not defined
    at window.<computed>.<computed> [as sendImage] (__puppeteer_evaluation_script__:1:182958)
    at ExecutionContext._evaluateInternal (/home/aymenitc/whatsapp-bot/node_modules/puppeteer-core/lib/ExecutionContext.js:122:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ExecutionContext.evaluate (/home/aymenitc/whatsapp-bot/node_modules/puppeteer-core/lib/ExecutionContext.js:48:12)
  -- ASYNC --
    at ExecutionContext.<anonymous> (/home/aymenitc/whatsapp-bot/node_modules/puppeteer-core/lib/helper.js:111:15)
    at DOMWorld.evaluate (/home/aymenitc/whatsapp-bot/node_modules/puppeteer-core/lib/DOMWorld.js:112:20)
  -- ASYNC --
    at Frame.<anonymous> (/home/aymenitc/whatsapp-bot/node_modules/puppeteer-core/lib/helper.js:111:15)
    at Page.evaluate (/home/aymenitc/whatsapp-bot/node_modules/puppeteer-core/lib/Page.js:833:43)
    at Page.<anonymous> (/home/aymenitc/whatsapp-bot/node_modules/puppeteer-core/lib/helper.js:112:23)
    at Client.<anonymous> (/home/aymenitc/whatsapp-bot/node_modules/@open-wa/wa-automate/dist/api/Client.js:511:44)
    at Generator.next (<anonymous>)
    at /home/aymenitc/whatsapp-bot/node_modules/@open-wa/wa-automate/dist/api/Client.js:27:71
    at new Promise (<anonymous>)
    at __awaiter (/home/aymenitc/whatsapp-bot/node_modules/@open-wa/wa-automate/dist/api/Client.js:23:12)
    at Client.pup (/home/aymenitc/whatsapp-bot/node_modules/@open-wa/wa-automate/dist/api/Client.js:462:16)
    at Client.<anonymous> (/home/aymenitc/whatsapp-bot/node_modules/@open-wa/wa-automate/dist/api/Client.js:1619:36)
    at Generator.next (<anonymous>)
    at fulfilled (/home/aymenitc/whatsapp-bot/node_modules/@open-wa/wa-automate/dist/api/Client.js:24:58)

Expected Behavior

sending files was working fine before latest update

Steps To Reproduce

for example: await client.sendPtt(from, './media/output2.mp3', id ).catch(err => console.log('Caught exception: ', err))

create() code OR full CLI command + CONFIG

No response

DEBUG INFO

{
  "WA_VERSION": "2.2232.8",
  "WA_AUTOMATE_VERSION": "4.44.11",
  "BROWSER_VERSION": "HeadlessChrome/104.0.5112.101",
  "START_TS": 1662143060331,
  "RAM_INFO": "Total: 4.08 GB | Free: 2.25 GB",
  "PPTR_VERSION": "15.0.0",
  "LATEST_VERSION": true,
  "CLI": false,
  "PATCH_HASH": "CACHED-be7ae",
  "LAUNCH_TIME_MS": 28972,
  "ACC_TYPE": "PERSONAL",
  "chats": 196,
  "messages": 533,
  "contacts": 5611,
  "isMd": true,
  "INSTANCE_ID": "fea97528-a94e-4d27-a6a7-ad444f837427"
}

Environment

- OS: Linux 5.15
- Node: 16.17.0
- npm: 8.1.0

Screenshots/Logs

No response

Anything else?

No response

smashah commented 2 years ago

@aymenitc try now please