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

Dependency conflict with latest WalletConnect with Wagmi 2.X #57

Open
JoeLaw91 opened this issue Mar 27, 2024 · 6 comments
Open

Dependency conflict with latest WalletConnect with Wagmi 2.X #57

JoeLaw91 opened this issue Mar 27, 2024 · 6 comments

Comments

@JoeLaw91
Copy link

https://docs.walletconnect.com/web3modal/react/about?platform=wagmi

I tried to install latest WalletConnect with Wagmi 2.X with alrd installed tronwallet-adapter, I am getting dependency error from npm install.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/viem
npm ERR!   viem@"^1.5.3" from the root project
npm ERR!   peer viem@">=1" from @web3modal/[email protected]
npm ERR!   node_modules/@web3modal/ethereum
npm ERR!     @web3modal/ethereum@"^2.7.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer viem@"2.x" from @wagmi/[email protected]
npm ERR! node_modules/@wagmi/core
npm ERR!   peer @wagmi/core@">=1" from @web3modal/[email protected]
npm ERR!   node_modules/@web3modal/ethereum
npm ERR!     @web3modal/ethereum@"^2.7.1" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
@way2ex
Copy link
Contributor

way2ex commented Mar 28, 2024

You can update the the latest version of adapters and it does not have dependencies on @web3modal/ethereum.
If you still have dependency conflict, you can use npm i [email protected] --force to install your desired version.

@JoeLaw91
Copy link
Author

JoeLaw91 commented Apr 13, 2024

@way2ex , Hi Justin, good day, I tried to force install, but I am now getting this error:

NotSupportedError: Failed to execute 'define' on 'CustomElementRegistry': the name "w3m-button" has already been used with this registry

Call Stack
legacyCustomElement
node_modules/@lit/reactive-element/development/decorators/custom-element.js (7:0)
eval
node_modules/@lit/reactive-element/development/decorators/custom-element.js (42:0)
nt
node_modules/@web3modal/ui/dist/index.es.js (1:7278)
eval
node_modules/@web3modal/ui/dist/index.es.js (1:8147)
./node_modules/@web3modal/ui/dist/index.es.js
/build/static/chunks/node_modules_web3modal_ui_dist_index_es_js.js (998:1)
options.factory
/_next/static/chunks/webpack.js (712:31)
__webpack_require__```

When I run ```npm ls @web3modal/ui ```

I got:

├─┬ @tronweb3/[email protected]
│ └─┬ @tronweb3/[email protected]
│ └─┬ @web3modal/[email protected]
│ └── @web3modal/[email protected]
└─┬ @web3modal/[email protected]
└─┬ @web3modal/[email protected]
└── @web3modal/[email protected]

@way2ex
Copy link
Contributor

way2ex commented Apr 14, 2024

Without the real project i have no idea why the error occurs. It seems that the problem is due to @web3modal/ui . Could you please google the error message or create a minimal reproduction repo ?

@lakub-muravlov
Copy link

Without the real project i have no idea why the error occurs. It seems that the problem is due to @web3modal/ui . Could you please google the error message or create a minimal reproduction repo ?

Hi, I have the same issue while using web3modal for EVM based networks and Tron WalletConnectAdapter for tron connections. I've created minimal reproduction repository. Reproduction scenarios are described in readme. It seems that whatever of those modules loaded first sets a w3m-button to customElements registry which creates a conflict.

@way2ex
Copy link
Contributor

way2ex commented Jul 3, 2024

Without the real project i have no idea why the error occurs. It seems that the problem is due to @web3modal/ui . Could you please google the error message or create a minimal reproduction repo ?

Hi, I have the same issue while using web3modal for EVM based networks and Tron WalletConnectAdapter for tron connections. I've created minimal reproduction repository. Reproduction scenarios are described in readme. It seems that whatever of those modules loaded first sets a w3m-button to customElements registry which creates a conflict.

Thanks a lot for your reproduction repository. It seems that the error occurs due to @web3modal/ui registry w3m-button twice. We will try to update the @tronweb3/walletconnect-tron to replace @web3modal/standalone with @walletconnect/modal to fix the error.

The upgrade is likely to this resolution. It may take some time before the next version.

@way2ex
Copy link
Contributor

way2ex commented Jul 16, 2024

@tronweb3/[email protected] is released and it should work fine with ethereum.

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