Skip to content

fix: stop wallet QR codes crashing the connect modal - #478

Merged
kingjacob merged 1 commit into
masterfrom
fix/wallet-qr-crash
Nov 14, 2026
Merged

kingjacob merged 1 commit into
masterfrom
fix/wallet-qr-crash

Conversation

@kingjacob

@kingjacob kingjacob commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On app.union.finance, picking Rainbow, MetaMask or WalletConnect in the connect modal crashes the app whenever that wallet falls back to a QR code (its browser extension isn't installed). RainbowKit throws Error: invalid border=0 while rendering the QR code, and the app's error boundary replaces the page with "Oh no, something broke". Base is unaffected (it opens its own popup), as is any wallet whose extension is installed.

Cause

RainbowKit 2.2.11, still the latest release, pins cuer@0.0.3, which encodes QR codes with qr's encodeQR(value, "raw", { border: 0, … }). cuer depends on qr ~0, and since 4b9760d (the RainbowKit 2.2.11 bump) the lockfile resolves qr@0.6.0, which rejects border <= 0 (0.5.x only checked the type).

Fix

  • package.json resolutions: "cuer": "0.0.4". Its only change is qr@0.6 support: it asks for border: 1 and trims that ring off. The lockfile diff is just the cuer entry; qr stays at 0.6.0.
  • src/providers/walletQrCode.test.jsx: renders the Cuer QR code RainbowKit uses and checks the grid carries no border, so CI fails if a lock refresh pairs incompatible cuer / qr versions again.

The same fix is open upstream as rainbow-me/rainbowkit#2716 (unmerged; no RainbowKit release since 2.2.11). Drop the resolution once a RainbowKit release depends on cuer@>=0.0.4.

Verification

  • The new test fails on master with invalid border=0 and passes with this change.
  • yarn test (57 passed), yarn lint (0 errors), yarn build.
  • Headless browser with a fresh profile: the fixed build, served at the app.union.finance URL, shows the Rainbow, MetaMask and WalletConnect QR codes with no errors. The live site lands on the error page for all three.
  • cuer@0.0.4 + qr@0.6.0 produce grids identical to qr@0.5.5 with border: 0 (the pre-break output) for 4 WalletConnect-style URIs × 5 error-correction levels, so the codes scan as before.

@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
union-interface Ready Ready Preview Nov 14, 2026 8:56pm UTC

Request Review

Picking Rainbow, MetaMask or WalletConnect in the RainbowKit modal without
that browser extension installed threw "invalid border=0" while rendering
the QR code, and the app error boundary replaced the page with "Oh no,
something broke".

RainbowKit 2.2.11 (still the latest release) pins cuer 0.0.3, which calls
qr's encodeQR with border: 0. cuer depends on qr "~0", and since 4b9760d
the lockfile resolves qr 0.6.0, which rejects border <= 0. cuer 0.0.4 only
adds qr 0.6 support: it requests border: 1 and trims that ring, producing
the same grid. Resolve cuer to 0.0.4 until a RainbowKit release depends
on it.

Add a regression test that renders the cuer QR code and checks the grid
size, so CI fails if a lock refresh pairs incompatible cuer / qr again.
@kingjacob
kingjacob merged commit e962642 into master Nov 14, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — 047948c2 Deployed Nov 14, 2026 by vercel[bot]
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