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

Video not sending, i get error #1268

Closed roysG closed 2 years ago

roysG commented 2 years ago

I get this error when i try to send video:

Error: Evaluation failed: N 1290|4fe01f06b38d940eedcd2f1946b1bfb9 | at ExecutionContext._evaluateInternal (/root/server/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19) 1290|4fe01f06b38d940eedcd2f1946b1bfb9 | at runMicrotasks () 1290|4fe01f06b38d940eedcd2f1946b1bfb9 | at processTicksAndRejections (node:internal/process/task_queues:96:5) 1290|4fe01f06b38d940eedcd2f1946b1bfb9 | at async ExecutionContext.evaluate (/root/server/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16) 1290|4fe01f06b38d940eedcd2f1946b1bfb9 | at async Client.sendMessage (/root/server/node_modules/whatsapp-web.js/src/Client.js:632:28) 1290|4fe01f06b38d940eedcd2f1946b1bfb9 | Error: Evaluation failed: N 1290|4fe01f06b38d940eedcd2f1946b1bfb9 | at ExecutionContext._evaluateInternal (/root/server/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19) 1290|4fe01f06b38d940eedcd2f1946b1bfb9 | at runMicrotasks () 1290|4fe01f06b38d940eedcd2f1946b1bfb9 | at processTicksAndRejections (node:internal/process/task_queues:96:5) 1290|4fe01f06b38d940eedcd2f1946b1bfb9 | at async ExecutionContext.evaluate (/root/server/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16) 1290|4fe01f06b38d940eedcd2f1946b1bfb9 | at async Client.sendMessage (/root/server/node_modules/whatsapp-web.js/src/Client.js:632:28) Unhandled Rejection at Promise Promise { 1290|4fe01f06b38d940eedcd2f1946b1bfb9 | Error: Evaluation failed: N 1290|4fe01f06b38d940eedcd2f1946b1bfb9 | at ExecutionContext._evaluateInternal (/root/server/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19) 1290|4fe01f06b38d940eedcd2f1946b1bfb9 | at runMicrotasks () 1290|4fe01f06b38d940eedcd2f1946b1bfb9 | at processTicksAndRejections (node:internal/process/task_queues:96:5) 1290|4fe01f06b38d940eedcd2f1946b1bfb9 | at async ExecutionContext.evaluate (/root/server/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16) 1290|4fe01f06b38d940eedcd2f1946b1bfb9 | at async Client.sendMessage (/root/server/node_modules/whatsapp-web.js/src/Client.js:632:28) 1290|4fe01f06b38d940eedcd2f1946b1bfb9 | }

Relevant code

If applicable, add code snippets to help explain your problem.

Environment (please complete the following information):

WhatsApp

Library

Other

The sending video was working until the latest changes with the Socket before a week ago Sending Images working great

roysG commented 2 years ago

This is the code i am use to send the video: const media = await MessageMedia.fromUrl(file);

pedroslopez commented 2 years ago

Please check out https://wwebjs.dev/guide/handling-attachments.html#caveat-for-sending-videos-and-gifs

To send mp4s and other proprietary formats you need to use Google Chrome, as Chromium does not support them.

RafaelIngenium commented 2 years ago

I performed a test using Google Chrome and the same chromium error occurs. My version: Version 98.0.4758.102 (Official version) 64-bit

roysG commented 2 years ago

@pedroslopez, Thanks.

hchiapella commented 2 years ago

Same results here. When I tried to send a mp4 video (with chrome) get:

Error: Evaluation failed: N at ExecutionContext._evaluateInternal (/root/whatsapp-node/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:95:5) at async ExecutionContext.evaluate (/root/whatsapp-node/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16) at async Client.sendMessage (/root/whatsapp-node/node_modules/whatsapp-web.js/src/Client.js:594:28)

hchiapella commented 2 years ago

Same results here. When I tried to send a mp4 video (with chrome) get:

Error: Evaluation failed: N at ExecutionContext._evaluateInternal (/root/whatsapp-node/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:95:5) at async ExecutionContext.evaluate (/root/whatsapp-node/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16) at async Client.sendMessage (/root/whatsapp-node/node_modules/whatsapp-web.js/src/Client.js:594:28)

Bug from my side, using chrome video is sending ok. Client connection:

const client = new Client( { puppeteer: { headless: true , args: ['--no-sandbox', '--disable-setuid-sandbox', '--remote-debugging-port=9222']
, executablePath: '/usr/bin/google-chrome' } ,authStrategy: new LocalAuth({ clientId: "example" }) }
);

mrsaadfazal commented 1 year ago

Same results here. When I tried to send a mp4 video (with chrome) get: Error: Evaluation failed: N at ExecutionContext._evaluateInternal (/root/whatsapp-node/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:95:5) at async ExecutionContext.evaluate (/root/whatsapp-node/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16) at async Client.sendMessage (/root/whatsapp-node/node_modules/whatsapp-web.js/src/Client.js:594:28)

Bug from my side, using chrome video is sending ok. Client connection:

const client = new Client( { puppeteer: { headless: true , args: ['--no-sandbox', '--disable-setuid-sandbox', '--remote-debugging-port=9222'] , executablePath: '/usr/bin/google-chrome' } ,authStrategy: new LocalAuth({ clientId: "example" }) } );

Thats for gui i guess?