Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: No QueryClient set, use QueryClientProvider to set one #3

Open
whitemiaool opened this issue Mar 7, 2024 · 2 comments
Open

Comments

@whitemiaool
Copy link

whitemiaool commented Mar 7, 2024

运行
pnpm i
pnpm dev

访问
http://localhost:3000/web3

报错
Error: No QueryClient set, use QueryClientProvider to set one

image
@YuanBoXie
Copy link

import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

const queryClient = new QueryClient();

<QueryClientProvider client={queryClient}>
  <WagmiWeb3ConfigProvider config={config} wallets={[MetaMask()]} chains={[ScrollSepolia]}>
  ...
  </QueryClientProvider>

这样即可。

@yutingzhao1991
Copy link
Collaborator

import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

const queryClient = new QueryClient();

<QueryClientProvider client={queryClient}>
  <WagmiWeb3ConfigProvider config={config} wallets={[MetaMask()]} chains={[ScrollSepolia]}>
  ...
  </QueryClientProvider>

这样即可。

WagmiWeb3ConfigProvider 里面已经设置了 QueryClientProvider,按道理不需要这样。试试 pnpm i @tanstack/react-query --save 看看能不能解决。

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

No branches or pull requests

3 participants