-
Notifications
You must be signed in to change notification settings - Fork 291
Description
Description
I’m encountering a runtime error when sending messages using whatsapp-web.js. The error appears to be related to sendSeen and markedUnread, possibly due to changes in WhatsApp Web internals.
Error [TypeError]: Cannot read properties of undefined (reading 'markedUnread') at I (https://static.whatsapp.net/rsrc.php/v4i4Xq4/yf/l/en_US-j/cmH4AUm3ODG.js:1541:4171) at window.WWebJS.sendSeen (evaluate at Binding.<anonymous> (/home/ubuntu/verifotp/node_modules/whatsapp-web.js/src/Client.js:265:36), <anonymous>:13:40) at #evaluate (/home/ubuntu/verifotp/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:391:56) at async ExecutionContext.evaluate (/home/ubuntu/verifotp/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:277:16) at async IsolatedWorld.evaluate (/home/ubuntu/verifotp/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/IsolatedWorld.js:100:16) at async CdpFrame.evaluate (/home/ubuntu/verifotp/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Frame.js:362:20) at async CdpPage.evaluate (/home/ubuntu/verifotp/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Page.js:826:20) at async Client.sendMessage (/home/ubuntu/verifotp/node_modules/whatsapp-web.js/src/Client.js:1076:25) at async Client.<anonymous> (/home/ubuntu/verifotp/whatsapp_otp_bot.js:859:9)
Steps to Reproduce:
Initialize whatsapp-web.js client
Receive an incoming message
Call client.sendMessage() (or any method that triggers sendSeen)
Error occurs during execution
Expected Behavior:
Messages should be sent successfully without throwing a TypeError, and the message should be marked as seen correctly.
Actual Behavior:
The process fails with:
TypeError: Cannot read properties of undefined (reading 'markedUnread')
Environment:
OS: Ubuntu (server)
Node.js: (v20.19.5)
whatsapp-web.js: (v1.34.4)
Additional Context:
This issue may be related to recent changes in WhatsApp Web’s internal API, where markedUnread is no longer available or returns undefined. It seems to break the WWebJS.sendSeen evaluation.
Please let me know if a workaround or patch is available. I’m happy to help test any fixes.