Error: underlying network changed
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.5k
- Forks
- 5.4k
- PR merge metrics
- No merged PRs in 30d
Description
Bug Description
A clear and concise description of the bug.
I am very sorry that I raised this issus,
I use your open source code a lot on my project, I am attracted by your code, so I am very happy to use your code on my project, during my development, I encountered a problem, I I don't know if anyone else has raised it, but I still reproduce this problem in the production of uniswap, so I think I can raise it for you to see if it needs to be dealt with
Steps to Reproduce
- Copy https://app.uniswap.org/#/swap?chain=polygon in open
Open new Brower Tabs
!!!Please open it directly, do not refresh, do not click in from another page, directly copy the link and paste it into the address bar to open - Open Brower Console error looks
console error
useBlockNumber.tsx:59 Failed to get block number for chainId 137 Error: underlying network changed (event="changed", network={"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"}, detectedNetwork={"name":"matic","chainId":137,"ensAddress":null,"_defaultProvider":null}, code=NETWORK_ERROR, version=providers/5.6.2)
Expected Behavior
no error
solution
in web3-react issus
web3-react issues #127

change getLibrary to any
Additional Context

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at useBlockNumber.tsx:59 and reproduce the reported error by opening the Polygon Uniswap URL directly in a new browser tab. Compare the provider behavior with web3-react issue #127 and the reported getLibrary change; done means the underlying network changed error no longer appears for this flow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- blockchain, frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100