fix: resolve MetaMask wallet connection (missing @metamask/sdk + ThemeProvider) - #16
Open
aravpatel19 wants to merge 1 commit into
Open
aravpatel19 wants to merge 1 commit into
aravpatel19 wants to merge 1 commit into
Conversation
…dk dependency - Install @metamask/sdk@0.33.1, the peer dependency required by RainbowKit's metaMaskWallet connector. Its absence caused wagmi to throw at module evaluation, preventing all wallet connectors from initialising. - Read WalletConnect projectId from NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID env var (falling back to the original placeholder) so contributors can supply a real WalletConnect Cloud ID without touching source code. - Add ThemeProvider from next-themes so that useTheme() inside RainbowKitProviderWrapper has the required context. - Add .env.local.example documenting all available environment variables. Made-with: Cursor
✅ Deploy Preview for filecoin-onchain-cloud-dapp ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for fs-upload-dapp ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
nijoe1
reviewed
Mar 3, 2026
| "@filoz/synapse-sdk": "^0.38.0", | ||
| "@hookform/resolvers": "^5.2.2", | ||
| "@ipld/car": "^5.4.2", | ||
| "@metamask/sdk": "^0.33.1", |
Member
There was a problem hiding this comment.
I think the best solution here is to not include @metamask/sdk at all and just remove metamask from wagmi.ts rainbowkit includes metamask by default from what they are saying here
Author
There was a problem hiding this comment.
Yup, looked at the docs and that makes sense. Thanks for making the fix on the live version.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Clicking Connect Wallet then MetaMask produced no popup. Two root causes:
Missing @metamask/sdk dependency — RainbowKit's metaMaskWallet connector requires @metamask/sdk as a peer dependency, but it was not in package.json. This caused wagmi to throw at module evaluation, preventing all wallet connectors from initialising.
Missing ThemeProvider — RainbowKitProviderWrapper calls useTheme() from next-themes, but ThemeProvider was never added to the React tree, causing a context error.
Changes
Testing
cp .env.local.example .env.local && pnpm install && pnpm dev
Open http://localhost:3000, click Connect Wallet, MetaMask popup appears and connects successfully.