Uniswap / Uniswap/interface

Error: underlying network changed

Open
#3,903 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

  1. 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
  2. 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
image

change getLibrary to any

Additional Context
image

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.