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

Session is being initiated

Open ricardolanes opened this issue 1 month ago • 3 comments

curl -X 'POST' 'http://.:3000/client/sendMessage/992b8161fa6a50b2f50bb89b93c0c325' -H 'accept: /' -H 'Content-Type: application/json' -d '{ "chatId": "*******[email protected]", "contentType": "string", "content": "Hello World!" }'

return: "error": "Evaluation failed: TypeError: Cannot read properties of undefined (reading 'getChat')\n at pptr://puppeteer_evaluation_script:2:46"

ricardolanes avatar Nov 24 '25 19:11 ricardolanes

Might be https://github.com/avoylenko/wwebjs-api/issues/48, so pull the latest image.

avoylenko avatar Nov 24 '25 21:11 avoylenko

But I just did a docker compose pull.

ricardolanes avatar Nov 25 '25 00:11 ricardolanes

I discovered a problem.

When initializing a session, it works normally, but if you need to restart it for any reason, when the session is automatically initialized, it returns with this error:

"error": "Evaluation failed: TypeError: Cannot read properties of undefined (reading 'getChat')\n at pptr://puppeteer_evaluation_script:2:46"

Therefore, it's necessary to restart the entire process, creating a new session.

What is the impact of this? If you (as in my case) want to turn off the endpoint after it's configured, it's not possible because it's necessary to restart npm, and with that, the session returns broken.

ricardolanes avatar Nov 25 '25 01:11 ricardolanes