waha icon indicating copy to clipboard operation
waha copied to clipboard

[WEBJS] -

Open moulcode opened this issue 10 months ago • 8 comments

🐞 Bug report: WEBJS engine fails to send messages due to WhatsApp Web breaking change


Describe the bug

Sending a text message using the WEBJS engine consistently fails with a TypeError originating from WhatsApp Web internals.

The error occurs when calling POST /api/sendText and causes WAHA to return a 500 Internal Server Error. The crash happens inside window.WWebJS.sendSeen, where the property markedUnread is accessed but is now undefined.

This appears to be caused by a recent WhatsApp Web internal change. The issue persists even when setting WAHA_WEBJS_DISABLE_MARK_SEEN=true.


Version

{
  "version": "2025.12.2",
  "engine": "WEBJS",
  "tier": "CORE"
}

Tested after upgrading to the latest available release at the time of writing.


Steps

To Reproduce:

  1. Deploy WAHA using the WEBJS engine
  2. Authenticate a WhatsApp session successfully (QR scan works)
  3. Send a request to POST /api/sendText with a valid chatId and text
  4. Observe HTTP 500 response

Expected behavior

The message should be sent successfully, or the engine should fail gracefully without crashing due to changes in WhatsApp Web internals.


Requests - Responses

Request:

POST /api/sendText
Content-Type: application/json
{
  "chatId": "[email protected]",
  "text": "Hi there!",
  "session": "default"
}

Response:

{
  "statusCode": 500,
  "timestamp": "2026-01-19T22:42:54.575Z",
  "exception": {
    "message": "Cannot read properties of undefined (reading 'markedUnread')"
  }
}

Docker Logs

Relevant stack trace (trimmed):

TypeError: Cannot read properties of undefined (reading 'markedUnread')
    at window.WWebJS.sendSeen
    at WebjsClientCore.sendMessage
    at /app/node_modules/whatsapp-web.js/src/Client.js:1100:25
    at puppeteer ExecutionContext.evaluate

Screenshots

Not applicable (API-level error).


Additional context

  • This issue appears to be caused by a breaking change in WhatsApp Web
  • The internal property markedUnread no longer exists
  • The error occurs before WAHA_WEBJS_DISABLE_MARK_SEEN can prevent execution
  • The issue reproduces on a clean installation
  • Switching to the BAILEYS engine resolves the problem completely

Because of this, the WEBJS engine is currently unusable for sending messages.


Thank you for maintaining WAHA. Let me know if additional logs or tests are needed 🙏

moulcode avatar Jan 19 '26 23:01 moulcode

Hi. Same error here.

Currently using: WEBJS (2025.9.4 PLUS)

{
  "statusCode": 500,
  "timestamp": "2026-01-20T09:12:15.058Z",
  "exception": {
    "message": "Cannot read properties of undefined (reading 'markedUnread')",
    "name": "TypeError",
    "stack": "TypeError: Cannot read properties of undefined (reading 'markedUnread') at window.WWebJS.sendSeen
...
  "request": {
    "path": "/api/sendText",
    "method": "POST",
    "body": {
      "chatId": "xxxxxx",
      "reply_to": null,
      "text": "Hi there!",
      "linkPreview": true,
      "linkPreviewHighQuality": false,
      "session": "default"
    },
    "query": {}
  },
  "version": {
    "version": "2025.9.4",
    "engine": "WEBJS",
    "tier": "PLUS",
    "browser": "/usr/bin/chromium"
  }

Globerada avatar Jan 20 '26 09:01 Globerada

+1

zhupantk avatar Jan 20 '26 10:01 zhupantk

Same here. I have a production ready application that integrates with waha and all of a sudden it stopped working with this exact same bug.

gui-uchoa avatar Jan 20 '26 14:01 gui-uchoa

+1

StreckrauppAKAD avatar Jan 20 '26 14:01 StreckrauppAKAD

Please update to latest version, its working for Send Seen and Send Text

agungyaa86 avatar Jan 20 '26 17:01 agungyaa86

Updated to the latest version (2026.1.3) and sendText is working, but sendSeen is not. It logs back that the POST call was successfull, but in WhatsApp it doesn't mark as read.

Example of WAHA log:

waha-service | [18:49:43.027] INFO (48): request completed {"reqId":13,"req":{"id":13,"method":"POST","url":"/api/sendSeen","query":{},"params":{"path":["api","sendSeen"]}},"res":{"statusCode":201},"responseTime":60}

Still doesn't appear in WhatsApp the seen check :(

gui-uchoa avatar Jan 20 '26 19:01 gui-uchoa

🛠️ Fixes

  • 2026.1.3 - WEBJS - fix api/sendText - #1810

patron:PRO

devlikepro avatar Jan 21 '26 07:01 devlikepro

https://github.com/devlikeapro/waha/issues/1818#issuecomment-3766166699

patron:PRO

devlikepro avatar Jan 21 '26 07:01 devlikepro