reown-com / appkit

The full stack toolkit to build onchain app UX
https://reown.com/appkit
Apache License 2.0
4.94k stars 1.41k forks source link

[bug] If we create an appkit for solana and evm at the same time, one of them will not load the wallets #3215

Open BeycanDeveloper opened 2 weeks ago

BeycanDeveloper commented 2 weeks ago

Link to minimal reproducible example

https://stackblitz.com/edit/vitejs-vite-1dpisk?file=src%2Fmain.ts

Summary

I know about multichain but is there no way to create separate solana and evm appkit? If the user selects Solana as a network, I want to open the Solana appkit. If the user selects an EVM network, I want to open the EVM appkit, so the first option should not be entirely the appkit and the network should not be selected when clicking on the wallet, the network should be selected first and then the corresponding appkit should be created.

Or can you add a feature to completely reset the appkit? For example, while the process is running, I will reset the entire appkit process and then recreate it according to the selected network so that there is no conflict.

EVM:

Screenshot 2024-11-07 at 21 11 46

Solana:

Screenshot 2024-11-07 at 21 11 18

If, I disable Solana side EVM is working.

I tested the following repository in two ways, directly with the structure I built and in plain form. But I can't create a separate appkit for solana and evm at the same time, they always get mixed up. I think it would be better if each appkit works independently of each other with different options.

https://github.com/BeycanDeveloper/appkit-test

List of related npm package versions

All is latest version. I just updated today from web3modal

ethers @reown/appkit @reown/appkit-adapter-ethers @reown/appkit-adapter-solana

BeycanDeveloper commented 2 weeks ago

I solved the partial corruption with lazy load, at least whichever one opens first opens properly. However, for example, if a user wants to make consecutive transactions in ethereum and solana without refreshing the page, they will be able to connect to ethereum at first, but then they will not be able to create an appkit for solana. It also doesn't give a warning for solana but I get the following output for evm.

Screenshot 2024-11-07 at 22 14 50

Also there is don't have any way to disable event console logs

BeycanDeveloper commented 2 weeks ago

However, strangely, in the appkit-test repository I sent you, the modals open even if they are mixed together, but in my build, one modal opens and the other does not. Why could this happen?

BeycanDeveloper commented 2 weeks ago

Also, even if an error is thrown in the createAppKit section, the appKit object is created but the modal does not open. I just tried to open solana and evm respectively and I get different objects in both, but I think the modal process cannot work independently in both.

Screenshot 2024-11-07 at 22 19 21 Screenshot 2024-11-07 at 22 19 33