Whatsapp-web.js: Error sending videos

Created on 11 Nov 2020  路  1Comment  路  Source: pedroslopez/whatsapp-web.js

Bug description

I'm getting this error when I try to send media messages with videos

(node:916) UnhandledPromiseRejectionWarning: Error: Evaluation failed: t
    at ExecutionContext._evaluateInternal (C:\Projetos\gartic-whatsapp-bot\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:217:19)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at ExecutionContext.evaluate (C:\Projetos\gartic-whatsapp-bot\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:106:16)
    at Client.sendMessage (C:\Projetos\gartic-whatsapp-bot\node_modules\whatsapp-web.js\src\Client.js:469:28)    
    at PassThrough.<anonymous> (C:\Projetos\gartic-whatsapp-bot\src\controllers\YoutubeController.ts:168:9)      
(node:916) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:916) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Reproduction steps

My code looks like this:

const file = 'C:/absolute/path/to/file.mp4'
const media = MessageMedia.fromFilePath(file);
await msg.reply(media);

I'm using this version of the library: whatsapp-web.js": "^1.11.0

It's worth mention that I'm trying to send a 1.8mb video, so I don't think the size is the problem

bug

Most helpful comment

Solved. In order to send videos you have to give puppeteer the path to a separately installed Chrome browser

const client = new Client({
    puppeteer: {
        executablePath: '/path/to/Chrome',
    }
})

I think this should be in the readme.

>All comments

Solved. In order to send videos you have to give puppeteer the path to a separately installed Chrome browser

const client = new Client({
    puppeteer: {
        executablePath: '/path/to/Chrome',
    }
})

I think this should be in the readme.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

parthibd picture parthibd  路  4Comments

ncesar picture ncesar  路  7Comments

waltergammarota picture waltergammarota  路  8Comments

dedenhendrap picture dedenhendrap  路  8Comments

ocracy picture ocracy  路  5Comments