Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

getChain() fails with Metamask/Ganache #9

Open
topac opened this issue Dec 4, 2020 · 2 comments
Open

getChain() fails with Metamask/Ganache #9

topac opened this issue Dec 4, 2020 · 2 comments

Comments

@topac
Copy link

topac commented Dec 4, 2020

I'm using the official live demo here https://web3modal.github.io/web3modal-vanilla-js-example/
Metamask connected.
If the chain is changed to http://127.0.0.1:8545 (Ganache), I got the following error:

Uncaught (in promise) Error: No chain found matching chainId: 1337
    at Object.i [as getChain] (index.min.js:1)
    at fetchAccountData (example.js:88)
    at async refreshAccountData (example.js:152)
    at async HTMLButtonElement.onConnect (example.js:185)

Everything is file when using Mainnet or Ropsten.

@pedrouid
Copy link
Contributor

pedrouid commented Dec 4, 2020

This example uses an NPM package called evm-chains which provides data about public chains that are EVM-compatible (like Ethereum)

Since Ganache is not a public chain it will fail to find data for it matching the chainId 1337 so I'm not sure this is necessarily a bug or out-of-scope of this example

Perhaps we could make an assumption that any unknown chains would be testnet but that's still too ambiguous IMO

What do you think @miohtama?

@miohtama
Copy link
Contributor

miohtama commented Dec 4, 2020

I will fix the example to show the chain as "unknown" when the database lacks an entry.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants