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.92k stars 338 forks source link

Failed to get QrCode response after Initializing session #2394

Closed Marceloxdxd closed 3 weeks ago

Marceloxdxd commented 1 month ago

Description

I'm using the WPPConnect API to establish a WhatsApp session, and I anticipate receiving a QR code to complete the connection setup. The problem is that when I made a "https://website.com/api/{session}/logout-session" and then try to start session again. It returns a status of "INITIALIZING" without providing a QR code or "CLOSED" without providing QR code. This also applies with qrcode-session. Also, when trying to start session again it returns: "CONNECTED". This also happens both in postman and in my page.

Environment

WPPConnect version(s): 1.34.2 Browser: Opera GX Node version: 20.16.0 WhatsApp version: 2.3000.1017570007 MultiDevice (BETA):no

Steps to Reproduce

  1. Start a session by providing details - /start-session
  2. Try to get qr code providing details -/qrcode-session
  3. Try to start session again
  4. closing the session by providing details - /close-session
  5. Instead of closing the session in step 4 try /logout-session

Log Output

  1. { "status": "CLOSED", "qrcode": null }

  2. { "status": "CONNECTED", "message": "QRCode is not available..." }

  3. { "status": "CONNECTED", "qrcode": null, "version": "2.7.0" }

  4. { "status": true, "message": "Session successfully closed" }

  5. { "status": false, "message": "Error closing session", "error": { "name": "TargetCloseError", "cause": { "name": "ProtocolError" }, "level": "error" } }

jaetma commented 3 weeks ago

Hello, any updates on this? I am having the same problem even after update my wppconnect "@wppconnect-team/wppconnect": "^1.35.0"

whatsjsapi  | info:     
whatsjsapi  |    _       ______  ____  ______                            __ 
whatsjsapi  |   | |     / / __ \/ __ \/ ____/___  ____  ____  ___  _____/ /_
whatsjsapi  |   | | /| / / /_/ / /_/ / /   / __ \/ __ \/ __ \/ _ \/ ___/ __/
whatsjsapi  |   | |/ |/ / ____/ ____/ /___/ /_/ / / / / / / /  __/ /__/ /_  
whatsjsapi  |   |__/|__/_/   /_/    \____/\____/_/ /_/_/ /_/\___/\___/\__/
whatsjsapi  | info:     Checking for updates
whatsjsapi  | (node:1) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
whatsjsapi  | (Use `node --trace-deprecation ...` to show where the warning was created)
whatsjsapi  | Server running on port 3005
whatsjsapi  | info:     You're up to date
whatsjsapi  | info:     [test:browser] Using browser folder '/app/sessions/test'
whatsjsapi  | info:     [test:browser] Initializing browser...
whatsjsapi  | http:     [test:browser] checking headless...
whatsjsapi  | http:     [test:browser] headless option is active, browser hidden
whatsjsapi  | info:     [test:client] Initializing...
whatsjsapi  | verbose:  [test:client] Setting WhatsApp WEB version to 2.3000.10162x
whatsjsapi  | verbose:  [test:client] Loading WhatsApp WEB
whatsjsapi  | verbose:  [test:page] Page loaded
whatsjsapi  | verbose:  [test:client] Injecting wapi.js
whatsjsapi  | verbose:  [test:client] WhatsApp WEB loaded
whatsjsapi  | http:     [test:client] Waiting page load
whatsjsapi  | info:     [test:session] Session Unpaired
whatsjsapi  | verbose:  [test:client] wapi.js injected
whatsjsapi  | debug:    [test:client] Exposing onMessage function
whatsjsapi  | debug:    [test:client] Exposing onAnyMessage function
whatsjsapi  | info:     [test:client] WA-JS version: 3.13.1
whatsjsapi  | debug:    [test:client] Exposing onAck function
whatsjsapi  | debug:    [test:client] Exposing onNotificationMessage function
whatsjsapi  | debug:    [test:client] Exposing onParticipantsChanged function
whatsjsapi  | debug:    [test:client] Exposing onStateChange function
whatsjsapi  | debug:    [test:client] Exposing onStreamChange function
whatsjsapi  | debug:    [test:client] Exposing onIncomingCall function
whatsjsapi  | debug:    [test:client] Exposing onInterfaceChange function
whatsjsapi  | debug:    [test:client] Exposing onPresenceChanged function
whatsjsapi  | debug:    [test:client] Exposing onLiveLocation function
whatsjsapi  | debug:    [test:client] Exposing onAddedToGroup function
whatsjsapi  | debug:    [test:client] Exposing onRevokedMessage function
whatsjsapi  | debug:    [test:client] Exposing onReactionMessage function
whatsjsapi  | debug:    [test:client] Exposing onPollResponse function
whatsjsapi  | debug:    [test:client] Exposing onUpdateLabel function
whatsjsapi  | debug:    [test:client] Exposing onOrderStatusUpdate function
whatsjsapi  | http:     [test:client] Checking is logged...
whatsjsapi  | info:     [test:client] Auto close configured to 60s
whatsjsapi  | http:     [test:client] Waiting for QRCode Scan...
whatsjsapi  | http:     [test:client] Auto close remain: 50s
whatsjsapi  | http:     [test:client] Auto close remain: 40s
whatsjsapi  | http:     [test:client] Auto close remain: 30s
whatsjsapi  | http:     [test:client] Auto close remain: 20s
renat473 commented 3 weeks ago

QR Code guys, I needed to go to the node_modules/@wppconnect-team/wppconnect/dist/config/create-config.js file and change the version to 2.3000.10177x for it to work.