https://github.com/tempoxyz/accounts-sdk-duplicate-iframe-repro
Minimal repro: tempoWallet() connector injects duplicate iframes
https://github.com/tempoxyz/accounts-sdk-duplicate-iframe-repro
Last synced: 2 days ago
JSON representation
Minimal repro: tempoWallet() connector injects duplicate iframes
- Host: GitHub
- URL: https://github.com/tempoxyz/accounts-sdk-duplicate-iframe-repro
- Owner: tempoxyz
- Created: 2026-04-08T21:04:30.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-04-08T21:47:06.000Z (3 months ago)
- Last Synced: 2026-04-08T23:28:14.824Z (3 months ago)
- Language: TypeScript
- Size: 44.9 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# accounts SDK — duplicate iframe repro
Minimal reproduction of `tempoWallet()` injecting duplicate `` elements into the DOM.
## The bug
`Dialog.iframe()` unconditionally creates a new `` + `` and appends it to `document.body` on every setup call. The wagmi connector's `provider ??=` guard only protects within a single connector instance — it doesn't prevent multiple connector instances from each creating their own iframe.
This happens when:
- **Multiple demo/page components** each create their own `createConfig({ connectors: [tempoWallet()] })`
- **React StrictMode** double-mounts in dev → 2 iframes on first load
- **Config is created inside a React component** (re-created every render)
- **HMR** re-evaluates the module → new connector → new iframe
This repro simulates the docs site pattern: multiple page components each creating their own wagmi config.
## Repro steps
```bash
npm install
npm run dev
```
1. Open `https://localhost:5199` — observe iframe count climbing (StrictMode + re-renders)
2. Click "Add another page" — adds another config → another iframe
3. Inspect DOM: `document.querySelectorAll('dialog[data-tempo-wallet]').length`
**Note:** We explicitly pass `Dialog.iframe()` to the connector to bypass the SDK's insecure-context check (which falls back to `popup()` on `http://` and would mask the bug).
## Fix
See [PR #151](https://github.com/tempoxyz/accounts/pull/151) on `tempoxyz/accounts`.