Skip to content

fix: WhatsApp QR code not loading in web UI - #88

Open
hasnainzxc wants to merge 1 commit into
gommzystudio:masterfrom
hasnainzxc:fix/whatsapp-qr-not-loading
Open

hasnainzxc wants to merge 1 commit into
gommzystudio:masterfrom
hasnainzxc:fix/whatsapp-qr-not-loading

Conversation

@hasnainzxc

Copy link
Copy Markdown

Fixes the WhatsApp QR code never appearing in the web UI, reported across multiple issues (#3, #16, #35, #67, #70, #74, #29, #32).

Root causes fixed

  1. Client socket URL mismatch (no QR code #3, Frontend "DISCONNECTED" - QR Code generated successfully on server but not displayed in browser. #16, QR Scanner Not showing #35) - App.tsx hardcoded localhost:3001. In Docker/remote deploys the browser connected to itself and never received the qr event. Backend URL is now derived from window.location.hostname, overridable via REACT_APP_API_URL / REACT_APP_SOCKET_URL.

  2. Baileys WhatsApp version drift (QR code is not generating anymore for whatsapp since last 4 hours #67, hello it was using an older version i have ugraded it now it works fine with newer api #70, Follow up (WA not working) #74) - unpinned makeWASocket connects with a stale WA Web protocol version, causing 'QR refs attempts ended' loops and 405 errors. Pinned version [2, 3000, 1034074495] in src/server.ts.

  3. Signal container failure kills the server (QR code will not load #29, Can't start web interface #32) - start:signal-api exits 1 when Docker is unavailable, so the backend (and the QR endpoint) never started. Made the step non-fatal with || true in package.json.

Also fixes the Recharts labelFormatter TS2322 error in ContactCard.tsx (referenced by #65, #68, #69) that blocked the entire client build, which also prevented QR display in Docker images.

Verification

  • npm run build (tsc) passes
  • npm run build (react-scripts) compiles clean
  • Server generates QR, client receives qr socket event, QRCodeSVG renders (tested against a running instance)

Fixes three root causes reported across issues gommzystudio#3, gommzystudio#16, gommzystudio#35, gommzystudio#67, gommzystudio#70, gommzystudio#74:

1. Client socket URL mismatch (docker/remote deploy). App.tsx hardcoded
   localhost:3001, so the browser connected to itself instead of the
   backend and never received the 'qr' event. Derive the backend URL from
   window.location.hostname with REACT_APP_API_URL/REACT_APP_SOCKET_URL
   overrides.

2. Baileys WA version drift. Unpinned makeWASocket connects with a stale
   WhatsApp Web protocol version, causing 'QR refs attempts ended' loops
   and 405 errors. Pin version [2, 3000, 1034074495] in server.ts.

3. Signal container failure killed the whole server. start:signal-api
   exits 1 when Docker is unavailable, so the backend (and QR) never
   started. Make the step non-fatal with || true.

Also fixes the Recharts labelFormatter TS2322 error in ContactCard that
blocked the client build entirely (issues gommzystudio#65, gommzystudio#68, gommzystudio#69).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant