whatsapp-http-api
whatsapp-http-api copied to clipboard
[BUG][WEBJS] - Unable to Reply to a message - Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'unsafe')\n at window.WWebJS.sendMessage
Hello,
We are sending following request to /reply end point and it throws 500 exception and does not send a message.
JSON
{"chatId":"[email protected]","session":"60107","type":"text","text":"\u05e9\u05dc\u05d5\u05dd \u05d5\u05d1\u05e8\u05db\u05d4. \u05e0\u05d9\u05ea\u05df \u05dc\u05e7\u05d1\u05d5\u05e2 \u05d1\u05d8\u05dc\u05e4\u05d5\u05df: 026426583. \u05d0\u05d5 \u05d1\u05de\u05d9\u05d9\u05dc: [email protected]. \u05e8\u05e4\u05d5\u05d0\u05d4 \u05e9\u05dc\u05d9\u05de\u05d4","reply_to":"[email protected]_3A58812051D368F25110"}
Response
{"statusCode":500,"timestamp":"2023-08-01T12:31:30.901Z","exception":{"stack":"Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'unsafe')\n at window.WWebJS.sendMessage (__puppeteer_evaluation_script__:39:67)\n at __puppeteer_evaluation_script__:10:45\n at ExecutionContext._evaluateInternal (/app/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async ExecutionContext.evaluate (/app/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)\n at async Client.sendMessage (/app/node_modules/whatsapp-web.js/src/Client.js:815:28)\n at async /app/node_modules/@nestjs/core/router/router-execution-context.js:46:28\n at async /app/node_modules/@nestjs/core/router/router-proxy.js:9:17","message":"Evaluation failed: TypeError: Cannot read properties of undefined (reading 'unsafe')\n at window.WWebJS.sendMessage (__puppeteer_evaluation_script__:39:67)\n at __puppeteer_evaluation_script__:10:45","name":"Error"},"request":{"path":"/api/reply","method":"POST","body":{"chatId":"[email protected]","session":"60107","type":"text","text":"שלום וברכה. ניתן לקבוע בטלפון: 026426583. או במייל: [email protected]. רפואה שלימה","reply_to":"[email protected]_3A58812051D368F25110"},"query":{}},"version":{"version":"2023.7.16","tier":"PLUS","browser":"/usr/bin/chromium"}}
Does it happen with recent messages or with old one? With echo bot it works but may be because the message is in client cache...
The quick fix would be to fallback to usual message if you see 500 for POST /reply
.
This happens to normal message also. not only /reply end point.
Please fix it, it is happening with several instances now.