(node:21) UnhandledPromiseRejectionWarning: (node:21) [DEP0018] DeprecationWarning:
(node:21) 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:21) [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.
ini kenapa yah , sebelumnya semua berjalan normal mohon di bantu
I have the same error, it is a new installation, in another that I have, in the same vps provider, but in another account, it works perfectly.
Pastikan sudah menggunakan versi whatsapp-web.js terbaru dan Node.js v14 atau yang lebih baru.
Ini bukan versi simpul, itu membuat kesalahan yang sama dijelaskan dan versi simpul adalah root @ nodejs-ubuntu-s--1gb-AMD-sfo3-01: ~ # node -v v14.17.6
It is not the node version, it makes the same error described and the node version is root @ nodejs-ubuntu-s--1gb-amd-sfo3-01: ~ # node -v v14.17.6
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
at onClose (/opt/whatsapp-api/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:197:20)
at Interface.<anonymous> (/opt/whatsapp-api/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:187:68)
at Interface.emit (events.js:412:35)
at Interface.close (readline.js:451:8)
at Socket.onend (readline.js:224:10)
at Socket.emit (events.js:412:35)
at endReadableNT (internal/streams/readable.js:1317:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
(Use node --trace-warnings ... to show where the warning was created)
(node:1057) 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:1057) [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.
Try to add catch for initialize, see example below:
const { Client } = require("whatsapp-web.js");
const client = new Client();
// .....
// your another code
// .....
client.initialize().catch(_ => _);

const { Client } = require('whatsapp-web.js');
const client = new Client();
client.on('qr', (qr) => { // Generate and scan this code with your phone console.log('QR RECEIVED', qr); });
client.on('ready', () => { console.log('Client is ready!'); });
client.on('message', msg => { if (msg.body == '!ping') { msg.reply('pong'); } });
client.initialize();
it seems that is when you try to open the chromiun
That is a different issue, please read the error message for detail. You need to install another library to make Puppeteer running on Ubuntu.