pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
15.45k stars 3.68k forks source link

Error: Comms::sendIq called before startComms #1265

Closed vientoquesurcalosmares closed 2 years ago

vientoquesurcalosmares commented 2 years ago

Bug description

When you call the function "getProfilePicUrl" "without multi device" I get an error and therefore I don't get a response image:

Error: Evaluation failed: Error: Comms::sendIq called before startComms at N (https://web.whatsapp.com/bootstrap_qr.faeb72dc2a3a441a20d1.js:6:118757) at R.i (https://web.whatsapp.com/bootstrap_qr.faeb72dc2a3a441a20d1.js:6:117648) at Y (https://web.whatsapp.com/bootstrap_qr.faeb72dc2a3a441a20d1.js:5:243670) at new y (https://web.whatsapp.com/bootstrap_qr.faeb72dc2a3a441a20d1.js:5:236237) at https://web.whatsapp.com/bootstrap_qr.faeb72dc2a3a441a20d1.js:6:117623 at Generator.next (<anonymous>) at t (https://web.whatsapp.com/vendor1~bootstrap_qr.947b18aebaee33ade8af.js:2:63784) at s (https://web.whatsapp.com/vendor1~bootstrap_qr.947b18aebaee33ade8af.js:2:63995) at https://web.whatsapp.com/vendor1~bootstrap_qr.947b18aebaee33ade8af.js:2:64054 at Y (https://web.whatsapp.com/bootstrap_qr.faeb72dc2a3a441a20d1.js:5:243670) at ExecutionContext._evaluateInternal (D:\Ampps\www\Trabajo\2019\Orkestra_Base\whatsapi\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:221:19) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async ExecutionContext.evaluate (D:\Ampps\www\Trabajo\2019\Orkestra_Base\whatsapi\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:110:16) at async Client.getProfilePicUrl (D:\Ampps\www\Trabajo\2019\Orkestra_Base\whatsapi\node_modules\whatsapp-web.js\src\Client.js:879:28)

but if I connect as a multi device the method "getProfilePicUrl" responds with the url of the image correctly

jtouris commented 2 years ago

Fixed with PR https://github.com/pedroslopez/whatsapp-web.js/pull/1264

mayeyun commented 2 weeks ago

whatsapp-web.js 调用的时机不对!