[WEBJS] - π Bug Report: Error 500 when sending an audio file
AquΓ tienes el issue en inglΓ©s:
π Bug Report: Error 500 when sending an audio file
Description
When trying to send an audio file using the /api/sendVoice endpoint, the server responds with a 500 Internal Server Error. The error seems to be related to puppeteer-core and an evaluate execution in ExecutionContext.js.
π Steps to reproduce
- Make a
POSTrequest to/api/sendVoicewith the following payload:{ "chatId": "[email protected]", "file": { "mimetype": "audio/ogg; codecs=opus", "url": "https://goline-wabi.s3.us-east-2.amazonaws.com/a8b0f41f-d474-4212-adc9-bb34f478ff26/1743575658068-96dc1453f858eb02.ogg" }, "reply_to": null, "session": "a8b0f41f-d474-4212-adc9-bb34f478ff26" } - The server responds with a 500 error.
π¨ Error log
statusCode: 500
timestamp: 2025-04-02T06:43:02.973Z
exception:
stack:
at #evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:388:56)
at async ExecutionContext.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:275:16)
at async IsolatedWorld.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/IsolatedWorld.js:100:16)
at async CdpFrame.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Frame.js:341:20)
at async CdpPage.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Page.js:807:20)
at async WebjsClientPlus.sendMessage (/app/node_modules/whatsapp-web.js/src/Client.js:956:25)
message: "a"
name: "a"
π Additional information
-
API version:
2025.3.3 -
Engine:
WEBJS -
Browser used:
/usr/bin/chromium -
Platform:
Linux (Docker)
π― Possible cause
The error occurs when executing evaluate() in puppeteer-core, which suggests that the injected JavaScript code might be failing.
Possible solutions:
- Ensure that
page.evaluate()correctly handles execution in the browser context. - Check if the audio file is accessible and properly downloaded before sending.
- Verify whether a
waitForSelector()is needed before executingevaluate().
Hi! Could you try pulling and using devlikeapro/waha-plus:chrome docker image?
https://waha.devlike.pro/docs/how-to/engines/#docker-images
Are you sure that the link is publicly available? Try converting the file to base64 and send it this way