fcl-js icon indicating copy to clipboard operation
fcl-js copied to clipboard

[BUG] FCL/Hybrid Apps with the Rainbowkit Connecter Don't Respect Rainbowkit Switching Chains

Open briandoyle81 opened this issue 4 months ago • 0 comments

Current Behavior

Adding multiple chains to config in wagmi with Rainbowkit automatically enables a UI element that allows the user to switch chains:

export const config = createConfig({ chains: [ flowMainnet, flowTestnet, ], connectors, ssr: true, transports: { [flowMainnet.id]: http(), [flowTestnet.id]: http(), } });

Image

In a hybrid app, when attempting to enable both Flow EVM testnet and Flow EVM mainnet, the network is locked to whichever is set in accessNode.api

fcl.config({ "accessNode.api": "https://rest-mainnet.onflow.org", "discovery.wallet": "https://fcl-discovery.onflow.org/mainnet/authn", "walletconnect.projectId": "9b70cfa398b2355a5eb9b1cf99f4a981", })

Expected Behavior

Hybrid apps should respect the network selected by Rainbowkit

Steps To Reproduce

  1. Start with Jordan's hybrid app scaffold or similar
  2. Add both flowMainnet and flowTestnet to the wagmi config
  3. Run the app
  4. Attempt to switch networks
  5. Observe that the network does not switch and is stuck on the one selected in fcl.config
  6. Switch the network endpoint in fcl.config to the opposite
  7. Restart the app and observe it is now stuck in that network

Environment

- OS:
- Node:
- npm:

What are you currently working on that this is blocking?

No response

briandoyle81 avatar Jun 21 '25 01:06 briandoyle81