TypeError: Cannot read properties of undefined (reading 'serialize') when sending message
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)
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.
I had the same error, I recompiled using the avoylenko version and it worked normally.
{ "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