wppconnect-team / wppconnect

WPPConnect is an open source project developed by the JavaScript community with the aim of exporting functions from WhatsApp Web to the node, which can be used to support the creation of any interaction, such as customer service, media sending, intelligence recognition based on phrases artificial and many other things, use your imagination
https://wppconnect.io
Other
1.93k stars 339 forks source link

on start 'WAPI is not defined' #558

Closed antirek closed 3 years ago

antirek commented 3 years ago

Description

[whatsappsession:browser] Initializing browser...
[whatsappsession:client] Initializing...
Status Session:  isLogged
Session name:  whatsappsession
Status Session:  inChat
Session name:  whatsappsession
error on create ReferenceError: WAPI is not defined
    at __puppeteer_evaluation_script__:44:47
    at __puppeteer_evaluation_script__:44:78
    at j (https://web.whatsapp.com/bootstrap_qr.d3ab17b51a79359ce87d.js:2:379576)
    at new g (https://web.whatsapp.com/bootstrap_qr.d3ab17b51a79359ce87d.js:2:370471)
    at anonymous (__puppeteer_evaluation_script__:42:14)
[whatsappsession:client] WhatsApp WEB version: 2.2138.13
get instance-state

Environment

antirek commented 3 years ago

oh, I check again

And if I set whatsappVersion in config - it's fail, otherwise if I not set whatsappVersion and wppconnect use latest value 2.2138.13 - instance loaded well

antirek commented 3 years ago

No. Sometimes all is good with 2.2138.13, sometimes fail with this error.

Maybe increase timeout for evaluate injected code?

edgardmessias commented 3 years ago

I think there are some action that is not waiting for JS injection, because the print of whatsapp version occurs after successful injection.

antirek commented 3 years ago

I don't know what it was. For next days I start my wppconnect instance and all was ok. So strange...