pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
15.21k stars 3.63k forks source link

Error: Evaluation failed: l #1827

Closed afifslonongboy closed 10 months ago

afifslonongboy commented 1 year ago

Is there an existing issue for this?

Describe the bug

Error: Evaluation failed: l at ExecutionContext._evaluateInternal (C:\xampp\htdocs\wa-api\node_modules\whatsapp-web.js\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:221:19) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async ExecutionContext.evaluate (C:\xampp\htdocs\wa-api\node_modules\whatsapp-web.js\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:110:16) at async Client.sendMessage (C:\xampp\htdocs\wa-api\node_modules\whatsapp-web.js\src\Client.js:686:28)

Expected behavior

Error: Evaluation failed: l at ExecutionContext._evaluateInternal (C:\xampp\htdocs\wa-api\node_modules\whatsapp-web.js\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:221:19) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async ExecutionContext.evaluate (C:\xampp\htdocs\wa-api\node_modules\whatsapp-web.js\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:110:16) at async Client.sendMessage (C:\xampp\htdocs\wa-api\node_modules\whatsapp-web.js\src\Client.js:686:28)

Steps to Reproduce the Bug or Issue

Error: Evaluation failed: l at ExecutionContext._evaluateInternal (C:\xampp\htdocs\wa-api\node_modules\whatsapp-web.js\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:221:19) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async ExecutionContext.evaluate (C:\xampp\htdocs\wa-api\node_modules\whatsapp-web.js\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:110:16) at async Client.sendMessage (C:\xampp\htdocs\wa-api\node_modules\whatsapp-web.js\src\Client.js:686:28)

Relevant Code

No response

Browser Type

Google Chrome

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

No, I am not using Multi Device

Environment

run await client.getWWebVersion() = v 2.2244.6

Additional context

No response

Lucas-Angelo commented 1 year ago

Describe the bug

It happened to me too when trying to convert a specific video to a sticker. This error happens when I try to convert a specific video to a sticker (not with all videos, only one causes this).

Expected behavior

image

pyrobot        | Error: Evaluation failed: a
pyrobot        |     at ExecutionContext._evaluateInternal (/usr/pyrobot/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
pyrobot        |     at processTicksAndRejections (node:internal/process/task_queues:96:5)
pyrobot        |     at async ExecutionContext.evaluate (/usr/pyrobot/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
pyrobot        |     at async Client.sendMessage (/usr/pyrobot/node_modules/whatsapp-web.js/src/Client.js:686:28)
pyrobot        |     at async Object.sticker (/usr/pyrobot/src/functions/Commands.js:359:9)

Steps to Reproduce the Bug or Issue

This error happens when I try to convert a specific video to a sticker (not with all videos, only one causes this). This is the video: https://user-images.githubusercontent.com/49598959/208319245-65451134-ef4a-49cb-84dc-55ec6e801ab5.mp4

Relevant Code

    let mediaMessage;
    if (msg.type == "video") mediaMessage = await msg.downloadMedia();
    else if (msg.type == "image") mediaMessage = await msg.downloadMedia();

    if (mediaMessage) {
        await chat.sendMessage(mediaMessage, {
            sendMediaAsSticker: true,
            stickerName: customName || "lcs2001",
            stickerAuthor: "lucasangelo.com",
        });
    } else if (customMediaMessage) {
        await chat.sendMessage(customMediaMessage, {
            sendMediaAsSticker: true,
            stickerName: customName || "lcs2001",
            stickerAuthor: "lucasangelo.com",
        });
    } else await chat.sendMessage("Sobre-carga detectada ;(");
javalsai commented 7 months ago

This was closed but there is no relevant information (not even information about which commit fixed this), I'm facing the same issue on Bun on sending a image with viewOnce option (might not be fully supported, I'm just playing with the API) and I would like to at least know what might be causing this.

It would be nice if these exceptions had some description too, l is not quite descriptive.

javalsai commented 7 months ago

This was closed but there is no relevant information (not even information about which commit fixed this), I'm facing the same issue on Bun on sending a image with viewOnce option (might not be fully supported, I'm just playing with the API) and I would like to at least know what might be causing this.

It would be nice if these exceptions had some description too, l is not quite descriptive.

For some reason it seems that the data I'm passing to the function is incorrect, (Buffer.from(Bun.file(...).text()).toString('base64')) and copying the mechanism on MessageMedia.fromFilePath (fs.readFileSync(..., {encoding: 'base64'})) works. I'll dig into this, but the error message should really be improved imo.