While working on my Next login signup project, I encountered the following error: WagmiProviderNotFoundError: `useConfig` must be used within `WagmiProvider`. The documentation for this issue can be found <a href="https://wagmi.sh/react/api/WagmiProvider.html">here</a>.
This error occurred at useConfig (file:///vercel/path0/node_modules/wagmi/dist/esm/hooks/useConfig.js:10:15), useAccount (file:///vercel/path0/node_modules/wagmi/dist/esm/hooks/useAccount.js:8:20), useConnectionStatus (file:///vercel/path0/node_modules/@rainbow-me/rainbowkit/dist/index.js:115:27) and ConnectButton (file:///vercel/path0/node_modules/@rainbow-me/rainbowkit/dist/index.js:5489:28).
The version mentioned in the error is <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2b5c4a4c46426b19051e051a18">[email protected]</a>.
Details about this error are as follows:
details: undefined,
docsPath: '/api/WagmiProvider',
metaMessages: undefined,
shortMessage: '`useConfig` must be used within `WagmiProvider`.
Furthermore, there was an error prerendering page "/dashboard/wallet_connect". More information can be found <a href="https://nextjs.org/docs/messages/prerender-error">here</a>.
Another instance of the same error with a different version number occurred at useConfig (file:///vercel/path0/node_modules/wagmi/dist/esm/hooks/useConfig.js:10:15), useAccount (file:///vercel/path0/node_modules/wagmi/dist/esm/hooks/useAccount.js:8:20), useConnectionStatus (file:///vercel/path0/node_modules/@rainbow-me/rainbowkit/dist/index.js:115:27) and ConnectButton (file:///vercel/path0/node_modules/@rainbow-me/rainbowkit/dist/index.js:5489:28).
The second version mentioned is <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a8dfc9cfc5c1e89a869d86999b">[email protected]</a>.
Generating static pages (9/12)
✓ Generating static pages (12/12)
> Export encountered errors on following paths:
/dashboard/wallet_connect
Error: Command "npm run build" exited with 1
I recently added a "Connect Wallet" button to my project and deployed it on Vercel, but unfortunately ran into the above-mentioned error. Any insights or suggestions would be greatly appreciated.
My suspicion is that there might be an issue with the Wagmi provider.