Skip to content

Fix Farcaster wallet not showing in miniapp — SSR detection failure #754

@realproject7

Description

@realproject7

Bug

The Farcaster wallet option doesn't appear in the RainbowKit wallet picker even inside the Farcaster miniapp (Warpcast). The `isLikelyFarcasterContext()` detection returns `false`.

Root Cause

`hidden` in RainbowKit wallet config runs during connector list construction, which can happen server-side (SSR) or at module initialization time. On the server:

```typescript
function isLikelyFarcasterContext(): boolean {
if (typeof window === "undefined") return false; // ← SSR: always false
return !!w.ReactNativeWebView || w !== w.parent;
}
```

The wallet list is constructed once at import time in `lib/wagmi.ts`, so `hidden` evaluates during SSR → returns `false` → Farcaster wallet stays hidden even after hydration.

Fix

Option A: Never hide the Farcaster wallet

Remove the `hidden` check entirely. The Farcaster wallet will show for everyone, but it will gracefully fail outside Farcaster (the connector just won't connect). This is acceptable — users in a browser won't use it, and it doesn't break anything.

```typescript
const farcasterWallet = (): Wallet => ({
id: "farcaster",
name: "Farcaster",
iconUrl: "...",
iconBackground: "#855DCD",
// No hidden — always show. Connector gracefully fails outside Farcaster.
createConnector: () => farcasterMiniApp(),
});
```

Option B: Use a dynamic check that re-evaluates client-side

RainbowKit's `hidden` is called during render, not just at construction. But the wallet list itself is static. Could use a wrapper component that conditionally includes the Farcaster wallet based on client-side detection. More complex, less reliable.

Recommend Option A — simplest, no detection issues.

Files to modify

  • `lib/wagmi.ts` — remove `hidden` from `farcasterWallet`

Branch

`task/754-farcaster-wallet-visible`

Self-Verification (T3)

  • Farcaster wallet appears in wallet picker inside Warpcast miniapp
  • Farcaster wallet appears in regular browser (acceptable — fails gracefully)
  • Tapping Farcaster inside Warpcast connects the wallet
  • Other wallets still work
  • `npm run build` passes

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/T3Assigned to T3 builder agent

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions