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

Error when signing a message via QR code with a device on a different chain #3840

Open
1 task done
goshatravin opened this issue Apr 20, 2024 · 2 comments
Open
1 task done

Comments

@goshatravin
Copy link

goshatravin commented Apr 20, 2024

Describe the bug

When attempting to connect and sign a message to a wallet via QR code scanning, an error occurs if the scanning device's blockchain network is different from the networks configured in WAGMI's settings.

Expected: switching network prompt

Link to Minimal Reproducible Example

No response

Steps To Reproduce

  1. Configure wagmi with a specific set of blockchain networks.
  2. Attempt to connect a wallet using a QR code from a device that is on a different blockchain network.
  3. Click sign message
  4. Observe the error.

https://stackblitz.com/edit/new-wagmi-poptbs?file=src%2FApp.tsx

An error occurred when attempting to switch chain.

Details: Chain not configured.

Version: @wagmi/core@2.6.17
Version: viem@2.9.20

Wagmi Version

@wagmi/core@2.6.17

Viem Version

viem@2.9.20

TypeScript Version

5.1.6

Check existing issues

Anything else?

No response

@jxom jxom added the Needs Reproduction Misc: Needs Reproduction label Apr 21, 2024
Copy link
Contributor

Hello @goshatravin. Please provide a minimal reproduction using new.wagmi.sh for runtime issues or TypeScript Playground for type issues. Issues marked with "needs reproduction" will be closed if they have no activity within 3 days.

@goshatravin goshatravin changed the title Error when connecting via QR code with a device on a different chain Error when signing a message via QR code with a device on a different chain Apr 21, 2024
@jxom jxom removed the Needs Reproduction Misc: Needs Reproduction label Apr 22, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 26, 2024
@jxom jxom reopened this Apr 26, 2024
@isaacschwab
Copy link

isaacschwab commented May 7, 2024

I'm also seeing a similar issue with the WalletConnect Connector. However, I'm seeing this error when using chains that are defined in my config (mainnet, and sepolia), and I'm connected to them in my Wallet (Metamask Mobile).

The reproduction of this error is very inconsistent, probably related to some interaction with WalletConnect.

error from useSignMessage

Details: undefined is not an object (evaluating
'(n=this.namespaces[il)!=null?
n:this.namespaces[${i}:${s}]).defaultChain=s') Version:
viem@2.9.31

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