# \[Archive\] Uncaught Error: No QueryClient set, use QueryClientProvider to set one

**URL:** <https://builder.metamask.io/t/archive-uncaught-error-no-queryclient-set-use-queryclientprovider-to-set-one/993>\
**Category:** Embedded Wallets (Web3Auth)\
**Created:** [July 17, 2025, 5:04pm UTC](https://builder.metamask.io/t/archive-uncaught-error-no-queryclient-set-use-queryclientprovider-to-set-one/993 "2025-07-17T17:04:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thalles.passos](https://avatars.discourse-cdn.com/v4/letter/t/ea5d25/32.png) [@thalles.passos](https://builder.metamask.io/u/thalles.passos)\
**Post date:** [July 17, 2025, 5:04pm UTC](https://builder.metamask.io/t/archive-uncaught-error-no-queryclient-set-use-queryclientprovider-to-set-one/993/1 "2025-07-17T17:04:39Z")

</div>

> **🏛 Archived Content from Web3Auth Community**
> 
> This topic was originally posted by **thalles.passos** on 7/17/2025.  
> This content has been migrated from our previous community forum to preserve valuable discussions.

* * *

- **SDK Version** (package.json):

```json
		"@tanstack/react-query": "^5.83.0",
		"@web3auth/modal": "^10.0.5",
		"wagmi": "^2.15.7"

```

- **Platform** : Vite React
- **Browser Console Screenshots** :  

[![image](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/1X/090d58fca03703ce96c61d2c4973603d68877f9e.png)
image2292×486 138 KB
](https://web3auth.io/community/uploads/default/original/2X/8/8af7b2926a50877ae4b6a61aab5603d21cae9838.png "image")

Full code: [https://github.com/notuslabs/notus-api-examples/blob/main/examples/web3auth-wagmi/src/providers.tsx](https://github.com/notuslabs/notus-api-examples/blob/main/examples/web3auth-wagmi/src/providers.tsx)

---

<div class="post-metadata">

**Author:** ![w3abot](https://avatars.discourse-cdn.com/v4/letter/w/4da419/32.png) [@w3abot](https://builder.metamask.io/u/w3abot)\
**Post date:** [July 17, 2025, 5:06pm UTC](https://builder.metamask.io/t/archive-uncaught-error-no-queryclient-set-use-queryclientprovider-to-set-one/993/2 "2025-07-17T17:06:49Z")

</div>

Thank you for the detailed information and for sharing your code and screenshot!

**Summary of Your Issue:**

- **SDK Used:** Web3Auth Plug and Play (PnP) Web SDK
- **SDK Version:**
  - @web3auth/modal: ^10.0.5
  - @tanstack/react-query: ^5.83.0
  - wagmi: ^2.15.7

- **Platform:** Vite + React
- **Error:** `Uncaught Error: No QueryClient set, use QueryClientProvider to set one`
- **Code Reference:** [providers.tsx on GitHub](https://github.com/notuslabs/notus-api-examples/blob/main/examples/web3auth-wagmi/src/providers.tsx)
- **Screenshot Provided:** Yes

* * *

### Root Cause

This error is not directly from Web3Auth, but from the `@tanstack/react-query` library. It means that somewhere in your React component tree, a hook or component from `react-query` is being used without a parent `<QueryClientProvider>`.

When integrating Web3Auth with Wagmi (which in turn depends on `@tanstack/react-query`), you must wrap your app with both the `Web3AuthProvider` and the `QueryClientProvider`, as well as the custom `WagmiProvider` from Web3Auth.

* * *

### Solution

**You need to ensure your app’s entry point (e.g., `main.tsx` or `index.tsx`) is set up like this:**

```tsx
import ReactDOM from "react-dom/client";
import { Web3AuthProvider } from "@web3auth/modal/react";
import web3AuthContextConfig from "./web3authContext";
import { WagmiProvider } from "@web3auth/modal/react/wagmi";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import App from "./App";
const queryClient = new QueryClient();

```

- **Order matters** : `Web3AuthProvider` should wrap everything, then `QueryClientProvider`, then `WagmiProvider`, then your `App`.
- **Do not use the default WagmiProvider from `wagmi`** ; use the one from `@web3auth/modal/react/wagmi`.

**Reference:**

- [Web3Auth Docs: Ethereum Hooks & Wagmi Integration](https://web3auth.io/docs/sdk/web/react/ethereum-hooks#enterprise-menu)

* * *

### Action Items

1. Double-check your `main.tsx` or `index.tsx` and ensure the providers are nested as above.
2. Remove any duplicate or misplaced `<QueryClientProvider>` or `<WagmiProvider>` from other parts of your tree.
3. If you are using any Wagmi hooks or components in files not wrapped by these providers, move them inside the tree as shown.

* * *

If you make these changes and still see the error, please let us know and provide your updated entry file code. We’re here to help!

> Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.

> Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. [Web3Auth Developer Office Hours](https://web3auth.io/community/t/web3auth-developer-office-hours/8777)

---

<div class="post-metadata">

**Author:** ![maharshi](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/maharshi/32/1525_2.png) [@maharshi](https://builder.metamask.io/u/maharshi)\
**Post date:** [July 30, 2025, 12:43pm UTC](https://builder.metamask.io/t/archive-uncaught-error-no-queryclient-set-use-queryclientprovider-to-set-one/993/3 "2025-07-30T12:43:27Z")

</div>

Hey @thalles.passos  
Can you please join tomorrow’s Office Hours?  
We would be able to give you the dedicated attention this issue needs.

 ![](https://web3auth.io/community/letter_avatar_proxy/v4/letter/m/ce7236/48.png)[Web3Auth Developer Office Hours](https://web3auth.io/community/t/web3auth-developer-office-hours/8777) [Announcements](https://builder.metamask.io/community/c/announcements/5)

> Stuck somewhere in the integration? Join the biweekly MetaMask Office Hours & get help from our team. 
> 
> Before following the below steps, make sure your discord username is not a generic one (anything of the format name\_{any 6 digits}). If it is, follow these steps to change your username: [https://support.discord.com/hc/en-us/articles/213480948-How-do-I-change-my-Username](https://support.discord.com/hc/en-us/articles/213480948-How-do-I-change-my-Username)  
> The above step is mandatory to if you username is a generic one.  
> First and Third Thursday every month, 10:00 AM EST  
> Make sur…
