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

[BUG] Some error happened when import donate3 #1

Open
0xhardman opened this issue Aug 31, 2023 · 1 comment
Open

[BUG] Some error happened when import donate3 #1

0xhardman opened this issue Aug 31, 2023 · 1 comment

Comments

@0xhardman
Copy link
Member

Desc:
When I import donate3 by package, it will go wrong.
But if i import donate3 by cdn, everything is ok.
And I don't know how to fix this problem.

- error Error: `useClient` must be used within `WagmiConfig`.

Read more: https://wagmi.sh/react/WagmiConfig
    at useClient (file:///Users/hardman/Code/lxdao/donate3-sdk-import-demo/import/nextjs/node_modules/wagmi/dist/index.js:73:11)
    at useConnect (file:///Users/hardman/Code/lxdao/donate3-sdk-import-demo/import/nextjs/node_modules/wagmi/dist/index.js:659:18)
    at useWalletConnectors (file:///Users/hardman/Code/lxdao/donate3-sdk-import-demo/import/nextjs/node_modules/@rainbow-me/rainbowkit/dist/chunk-CDB4MGXW.js:985:67)
....

Expect:
import donate3 smoothly.

@newraina
Copy link

newraina commented Oct 23, 2023

你好,这个错误是因为 rainbowkit 和 donate3 使用了不同的 wagmi package 导致的,因此 rainbowkit 拿不到 donate3 里明明已经配置过的 WagmiConfig。猜测你可能用的 yarn 安装的 package?应该可以看到 node_modules 下的两个 wagmi:

  1. node_modules/wagmi
  2. node_modules/donate3-sdk/node_modules/wagmi

这应该是 yarn v1 的一个 bug 导致的,可以这样解决:不使用 yarn v1, 改用 yarn v3 / npm / pnpm

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 a pull request may close this issue.

2 participants