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.11k stars 589 forks source link

sendFile error: Cannot read properties of undefined (reading 'isNewsletter') #3152

Closed demartinoalexis closed 9 months ago

demartinoalexis commented 9 months 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?

Business account

Mode

My own code

Current Behavior

sendText works fine but when i try to send a PDF with sendFile the script crashes

Expected Behavior

send PDF to contact

Steps To Reproduce

send a PDF

create() code OR full CLI command + CONFIG

create({
    sessionId: sessionName,
    authTimeout: 60, 
    restartOnCrash: start,
    blockCrashLogs: true,
    disableSpins: true,
    headless: false,
    useChrome: true,
    hostNotificationLang: 'ES_AR',
    licenseKey: 'XXXX',
    //logConsole: true,
    sessionDataPath: 'open-wa/sessiones',
    popup: false,
    qrTimeout: 0,
    killProcessOnBrowserClose: true,
    skipUpdateCheck: false,
    useStealth: true,
    //throwErrorOnTosBlock:true,
    multiDevice: true,
    //deleteSessionDataOnLogout: true,
    //qrLogSkip: true,
    //skipSessionSave: true,

  }).then(client => start(client));

DEBUG INFO

{
  "WA_VERSION": "2.2353.0",
  "WA_AUTOMATE_VERSION": "4.66.3",
  "BROWSER_VERSION": "Chrome/117.0.5938.62",
  "START_TS": 1701789543599,
  "RAM_INFO": "Total: 7.75 GB | Free: 4.69 GB",
  "PPTR_VERSION": "19.11.1",
  "LATEST_VERSION": true,
  "CLI": false,
  "PATCH_HASH": "26363",
  "LAUNCH_TIME_MS": 31437,
  "ACC_TYPE": "BUSINESS",
  "chats": 10,
  "messages": 21,
  "contacts": 3506,
  "isBiz": true,
  "isMd": true,
  "INSTANCE_ID": "5fa54cbe-839c-411e-bbda-50afc37e3b9a"
}

Environment

- OS: Linux 5.15
- Node: 19.8.1
- npm: 9.5.1

Screenshots/Logs

No response

Anything else?

/home/xxxxx/interfaces/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:258 throw new Error('Evaluation failed: ' + (0, util_js_1.getExceptionMessage)(exceptionDetails)); ^

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'isNewsletter') at t.getMaxNumberSelectableMedia (https://web.whatsapp.com/app.e6352145ea3a831d9908.js:266:698715) at https://web.whatsapp.com/app.e6352145ea3a831d9908.js:311:752011 at Generator.next () at t (https://web.whatsapp.com/vendor1~app.faf9096ea5e5e9ae7ce7.js:2:66487) at s (https://web.whatsapp.com/vendor1~app.faf9096ea5e5e9ae7ce7.js:2:66698) at https://web.whatsapp.com/vendor1~app.faf9096ea5e5e9ae7ce7.js:2:66757 at new Promise () at https://web.whatsapp.com/vendor1~app.faf9096ea5e5e9ae7ce7.js:2:66638 at C.processAttachments (https://web.whatsapp.com/app.e6352145ea3a831d9908.js:311:752541) at window.. [as procFiles] (pptr://puppeteer_evaluation_script:1:490468) at ExecutionContext._ExecutionContext_evaluate (/home/xxxxx/interfaces/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:258:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async ExecutionContext.evaluate (/home/xxxxx/interfaces/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:146:16)

Node.js v19.8.1

glorium-robert commented 9 months ago

i have the same problem.

AmirSchwarz commented 9 months ago

me also

DanielMRodriguez commented 9 months ago

WhatsApp web was updated

dev7ion commented 9 months ago

Yes, and this repository not update again, anyone can solve this problem please..?

desarrollodxt commented 9 months ago

The update was about 2-3 weeks ago, the code refactoring might take a few weeks for repository contributors to notice, you could try forking it yourself, i wil try

smashah commented 9 months ago

This was actually due to the patches CDN billing not being topped up - yeah strange. Should be fixed now.

Comment back if it is still not working