whatsapp-web.js
whatsapp-web.js copied to clipboard
TimeoutError: Timed out after 30000 ms while trying to connect to the browser!
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
same issue here
+1
Have you solved this problem?
+1
+1
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
{
puppeteer: {
args: ["--no-sandbox"],
},
}
did the trick