#'Execution context was destroyed.'

13 messages · Page 1 of 1 (latest)

amber hawk
#

Was working pertfectly until today. Chromium is opening, but as soon as the WhatsApp page finishes loading, it crashes abruptly.

Whatsapp-web.js lib version: "github:pedroslopez/whatsapp-web.js#webpack-exodus"
Using cache: I tried both “Local” and “None”
Connecting normal.
Using chronium.

Error: error: new Errors_js_1.ProtocolError(),
^
ProtocolError: Protocol error (Runtime.callFunctionOn): Execution context was destroyed.

Client:
const cliente = new Client({
authStrategy: new LocalAuth({
dataPath: './../src/ws_session/',
}),
qrMaxRetries: 3,
puppeteer: {
headless: false,
executablePath: CHRONIUM_PATH,
args: [
"--no-sandbox",
"--no-first-run",
"--disable-setuid-sandbox",
"--disable-dev-shm-usage",
"--disable-accelerated-2d-canvas",
"--disable-gpu",
"--single-process",
"--no-zygote",
],
},
});

Any ideas will be appreciated.

alpine forge
#

protocol error usualy happen when you try load old session with new version of whatsapp, or sending big file, or sending message when your client not in ready state, just make sure you start fresh with new session (deleting old one), and make sure your client is ready before doing any automation script

amber hawk
#

I have already no session, and no automation is happeing before ready event is fired :/

alpine forge
#

or try with minimal option on your client, just use basic option with no args

#

usually no sandbox is used when healdess set to true

amber hawk
#

Well, it was resolved in a very curious way. Every time the bot started, the client crashed because the session closed automatically at startup. By adding a .catch() to the client's initialize function, I prevented it from crashing, which allowed me to scan the QR code from WhatsApp Web in Chromium. This generated and stored the session, preventing further crashes. Thanks 🫶

tulip needle
ancient cradle
ancient cradle
#

I Have already tried this PR (https://github.com/pedroslopez/whatsapp-web.js/pull/3200) which is to change "unzipper": "^0.10.11" to "unzipper": "^0.12.2" in my package.json

When I close my project after initializing it successfully, I notice that if I start it again without waiting a few seconds, I get Execution context was destroyed.

But if I wait a few seconds or more, I can usually initiate it again without getting this error. Is this normal?

GitHub

PR Details
This PR fixes an error when restoring the session in the remote authentication method when using nodejs in version > 16
Description
Error details:
ProtocolError: Protocol error (Runti...

tulip needle
#
const cliente = new Client({ 
    authStrategy: new LocalAuth({
      dataPath: './../src/ws_session/',
    }),
    qrMaxRetries: 3,
    puppeteer: {
      headless: false,
      executablePath: CHRONIUM_PATH,
      args: [
        "--no-sandbox",
        "--no-first-run",
        "--disable-setuid-sandbox",
        "--disable-dev-shm-usage",
        "--disable-accelerated-2d-canvas",
        "--disable-gpu",
        //"--single-process", //Remove it
        "--no-zygote",
      ],
    },
  });
ancient cradle
tulip needle
#

Using Exodus Version
Requer Node 18+
1- npm install github:pedroslopez/whatsapp-web.js#webpack-exodus;
2- If you are using, remove WebCache;
3- delete folders node_modules and wwebjs_auth;
4- npm install;
5- start seu bot.