whatsapp-web.js icon indicating copy to clipboard operation
whatsapp-web.js copied to clipboard

TimeoutError: Timed out after 30000 ms while trying to connect to the browser!

Open zitob9 opened this issue 2 years ago • 6 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

I deploy my code on google cloud functions but I get this error:

Exception from a finished function: TimeoutError: Timed out after 30000 ms while trying to connect to the browser! Only Chrome at revision r982053 is guaranteed to work.

Expected behavior

Should send the message

Steps to Reproduce the Bug or Issue

i test my code on my Macbook its works

but on google cloud functions doesn't work

Relevant Code

function sendWhatsapp(doctorPhone, message) {
  const client = new Client({
    authStrategy: new LocalAuth({
      clientId: "client-one"
    }),
    puppeteer: { headless: true },
  });

  client.on('qr', qr => {
    qrcode.generate(qr, { small: true });
  });

  client.on("ready", () => {
    console.log("Whatsapp is ready!");
    let wpNumber = "222" + doctorPhone.substring(1) + "@c.us";
    client.sendMessage(wpNumber, message);
  });
  client.initialize();
}

Browser Type

Chromium

WhatsApp Account Type

WhatsApp Business

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

node 16 google cloud functions whatsapp-web.js = last version

Additional context

No response

zitob9 avatar Aug 08 '22 19:08 zitob9

same issue here

Aromakelapa avatar Aug 09 '22 07:08 Aromakelapa

+1

owlpro avatar Aug 11 '22 17:08 owlpro

Have you solved this problem?

808basssrjj avatar Aug 27 '22 01:08 808basssrjj

+1

nacholupotti avatar Oct 14 '22 01:10 nacholupotti

+1

NaimCode avatar Nov 04 '22 19:11 NaimCode

Same error. I have "Timed out after 30000 ms while trying to connect to the browser! Only Chrome at revision r982053 is guaranteed to work" problem and it occurs more than 250 times per day

bohdanstefaniuk avatar Feb 11 '23 20:02 bohdanstefaniuk

{
  puppeteer: {
    args: ["--no-sandbox"],
  },
}

did the trick

karimkawambwa avatar Jul 01 '23 22:07 karimkawambwa