whatsapp-api icon indicating copy to clipboard operation
whatsapp-api copied to clipboard

TypeError: Cannot read properties of undefined (reading 'serialize') when sending message

Open Lookinghim opened this issue 6 months ago • 3 comments

I'm encountering an error when trying to send a message using the API. The message is actually sent successfully, but the server returns an error response, and the log shows a serialize error from getMessageModel.

Error log shown in Docker:

Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'serialize')

    at window.WWebJS.getMessageModel (pptr://__puppeteer_evaluation_script__:412:29)

    at pptr://__puppeteer_evaluation_script__:11:34

    at ExecutionContext._ExecutionContext_evaluate (/usr/src/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:229:15)

    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

    at async ExecutionContext.evaluate (/usr/src/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:107:16)

    at async Client.sendMessage (/usr/src/app/node_modules/whatsapp-web.js/src/Client.js:950:28)

    at async sendMessage (/usr/src/app/src/controllers/clientController.js:82:22)

Lookinghim avatar Jun 27 '25 17:06 Lookinghim

See https://github.com/pedroslopez/whatsapp-web.js/issues/3609

Feel free to switch to the forked project https://github.com/avoylenko/wwebjs-api where the library was updated.

avoylenko avatar Jun 27 '25 20:06 avoylenko

I had the same error, I recompiled using the avoylenko version and it worked normally.

jone22e avatar Jun 30 '25 13:06 jone22e

{ "success": false, "error": "Evaluation failed: TypeError: Cannot read properties of undefined (reading 'serialize')\n at window.WWebJS.getMessageModel (pptr://puppeteer_evaluation_script:412:29)\n at pptr://puppeteer_evaluation_script:11:34" }

Im use project https://github.com/avoylenko/wwebjs-api where the library was updated. but not worked

OmarMarie96 avatar Jul 14 '25 13:07 OmarMarie96