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] Appkit does no longer allow to switch to an unsupported chain in the wallet with allowUnsupportedChain set to true #3340

Open
paintoshi opened this issue Nov 27, 2024 · 1 comment
Labels
bug Something isn't working needs review

Comments

@paintoshi
Copy link

paintoshi commented Nov 27, 2024

Link to minimal reproducible example

https://stackblitz.com/edit/stackblitz-starters-36aam4?file=context%2Findex.tsx

Summary

With web3modal v5.1.9 it was possible to use allowUnsupportedChain: true in the createWeb3Modal. Then switch to another chain in the wallet, while still using the application.

With appkit, has that option been removed? When I switch network in rabby, a modal pops up blocking the whole application. This makes our app impossible to use since we have an integrated swap widget that needs to switch to other networks during the swap. While the application surrounding it only supports one network. I can't migrate to appkit for this reason.

createAppKit({
  adapters: [wagmiAdapter],
  networks: [mainnet],
  metadata,
  projectId,
  allowUnsupportedChain: true,
});

I supplied a project on stackblitz but it can't be tested there since the application won't detect wallet switches. Need to be downloaded and run locally.

yarn install
yarn dev

See this video:

rabby_switch.mp4

Looking at the old code I see it being referenced here (as in it won't display the modal if that param is set): https://github.com/reown-com/appkit/blob/V5/packages/core/src/controllers/NetworkController.ts#L121

But in the new code the whole NetworkController.ts has been removed and I can't find any reference to allowUnsupportedChain being used (when searching the whole repo). It seems the parameter is straight ignored here: https://github.com/reown-com/appkit/blob/main/packages/core/src/controllers/ChainController.ts#L222


Another issue is after switching to a supported network, which Rabby handles automatically, the modal does not close. Minor UX issue. Seen at the end of the video.

List of related npm package versions

"@reown/appkit": "^1.5.2",
"@reown/appkit-adapter-wagmi": "^1.5.2",
"@tanstack/react-query": "^5.61.4",
"next": "13.5.1",
"react": "18.2.0",
"viem": "^2.21.51",
"wagmi": "^2.13.0"

@paintoshi paintoshi added bug Something isn't working needs review labels Nov 27, 2024
@vanyasav
Copy link

Same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs review
Projects
None yet
Development

No branches or pull requests

2 participants