Skip to content

feat: wagmi v3 compatibility (rebased, all CI passing)#2627

Open
phelix001 wants to merge 4 commits intorainbow-me:mainfrom
phelix001:daniel/wagmi-v3
Open

feat: wagmi v3 compatibility (rebased, all CI passing)#2627
phelix001 wants to merge 4 commits intorainbow-me:mainfrom
phelix001:daniel/wagmi-v3

Conversation

@phelix001
Copy link

@phelix001 phelix001 commented Jan 28, 2026

Summary

This PR provides complete wagmi v3 support for RainbowKit, rebased on current main with all CI issues fixed.

This is a continuation of #2591 which has stale merge conflicts.

Changes

Core wagmi v3 Migration

  • Updated wagmi dependency from ^2.x to 3.x
  • Replaced useAccount with useConnection where appropriate
  • Added new dependencies for wallet connectors
  • Updated TypeScript to 5.7.3

SSG Build Fixes

Fixed WagmiProviderNotFoundError during Next.js Static Site Generation:

Pages Router examples:

  • Added 404.tsx and 500.tsx error pages without wagmi providers
  • Updated _app.tsx to exclude error pages from providers
  • Added getServerSideProps to opt out of SSG for wagmi pages

App Router examples:

  • Added export const dynamic = 'force-dynamic' to layout.tsx
  • Created not-found.tsx files without wagmi providers

Documentation site:

  • Changed RainbowKit imports to use next/dynamic with ssr: false
  • Added dynamic imports for Header, Playground, WalletButton

Templates:

  • Applied fixes to templates/next-app and generated-test-app

Verification

All checks pass locally:

  • pnpm build
  • pnpm test (89 tests passed)
  • pnpm lint

Breaking Changes

This is a major version bump - see migration guide updates included.

Related

/cc @DanielSinclair


PR-Codex overview

This PR focuses on upgrading the wagmi dependency to version 3, which introduces breaking changes. It modifies various components to use the new useConnection hook instead of useAccount. Additionally, it improves error handling for pages that do not require the RainbowKit providers.

Detailed summary

  • Upgraded wagmi from version 2.x to 3.x.
  • Replaced useAccount with useConnection in multiple components and hooks.
  • Added dynamic imports for components using wagmi hooks to prevent SSG errors.
  • Introduced 404 and 500 error pages without RainbowKit providers.
  • Updated package dependencies in various package.json files.
  • Enhanced migration documentation for RainbowKit and wagmi.

The following files were skipped due to too many changes: pnpm-lock.yaml

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@phelix001 phelix001 requested a review from a team as a code owner January 28, 2026 12:41
@changeset-bot
Copy link

changeset-bot bot commented Jan 28, 2026

🦋 Changeset detected

Latest commit: a5f0a5b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 19 packages
Name Type
@rainbow-me/rainbowkit Major
example Patch
@rainbow-me/rainbow-button Patch
@rainbow-me/rainbowkit-siwe-next-auth Major
rainbowkit-next-app Patch
site Patch
with-create-react-app Patch
with-next-app-i18n Patch
with-next-app Patch
with-next-custom-button Patch
with-next-mint-nft Patch
with-next-siwe-iron-session Patch
with-next-siwe-next-auth Patch
with-next-wallet-button Patch
with-next Patch
with-react-router Patch
with-remix Patch
with-vite Patch
with-next-rainbow-button Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@socket-security
Copy link

socket-security bot commented Jan 28, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​wagmi@​2.19.3 ⏵ 3.5.080 -2010079 +198 +1100
Addednpm/​@​tanstack/​react-query@​5.90.21991008898100
Updatednpm/​typescript@​5.5.4 ⏵ 5.7.3100 +110090 +110090

View full report

@lababidi
Copy link

Hey, I'm looking forward to this. could someone on the team look at this? @phelix001 did some good work to put this together. let's not let RK get stale please.

@encryptedDegen
Copy link

Any update on this moving forward?

Would be lovely to get Wagmi V3 support into rainbowkit

DanielSinclair and others added 3 commits February 21, 2026 10:10
wagmi v3 requires all hooks to be used within WagmiProvider context.
During Static Site Generation (SSG), pages are pre-rendered without
proper context, causing WagmiProviderNotFoundError.

Changes:
- Add 404/500 error pages without wagmi providers for all Next.js examples
- Update _app.tsx in Pages Router examples to exclude error pages from providers
- Add getServerSideProps to opt out of SSG where needed
- Use dynamic imports with ssr: false for site components using wagmi hooks
- Remove direct wagmi hook usage from layout components
- Add export const dynamic = 'force-dynamic' for App Router examples

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Feb 21, 2026

@phelix001 is attempting to deploy a commit to the rainbowdotme Team on Vercel.

A member of the Team first needs to authorize it.

@phelix001
Copy link
Author

Rebased & Conflict-Free

Just rebased this PR on current main (as of today, Feb 21 2026). All merge conflicts are resolved and the PR is now mergeable.

For teams blocked by this

In the meantime, you can use our pre-built fork package directly:

npm install @rainbow-me/rainbowkit@github:phelix001/rainbowkit#v2.2.10-wagmi3

Or reference the release: https://github.com/phelix001/rainbowkit/releases/tag/v2.2.10-wagmi3

For maintainers

@DanielSinclair @markdalgleish @jxom — this PR is the rebased, clean version of #2591 with all SSG/SSR fixes included. It's been blocking multiple teams for 2+ months now. Would really appreciate a review and merge so the community can move to wagmi v3.

The changes are minimal and well-scoped:

  • Updated wagmi peer dep from ^2.x to 3.x
  • Replaced deprecated useAccount with useConnection
  • Fixed SSG build errors in all Next.js examples
  • 89 tests passing, lint clean

wagmi v3 does not export a `gemini` connector from `wagmi/connectors`,
causing build failures. Switch geminiWallet to use the standard
injected provider pattern (like other EIP-6963 wallets) instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

wagmi v3 support - PR #2591 blocked, community fix available

4 participants