Uniswap / Uniswap/interface

Crash report: `Error: Invariant failed`

Open
#2,677 5 comments 0 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

URL

https://app.uniswap.org/#/swap?inputCurrency=0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce&outputCurrency=ETH

swap state

{
  "INPUT": {
    "currencyId": "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE"
  },
  "OUTPUT": {
    "currencyId": "ETH"
  },
  "independentField": "INPUT",
  "typedValue": "",
  "recipient": "0x4014d002b839a38f727604e4298b136e7424729b"
}

Error

Error: Invariant failed

Stacktrace

Error: Invariant failed
    at https://app.uniswap.org/static/js/35.a759c04b.chunk.js:2:135543
    at t.sortsBefore (https://app.uniswap.org/static/js/35.a759c04b.chunk.js:2:68832)
    at https://app.uniswap.org/static/js/main.411b0c26.chunk.js:1:166500
    at Array.map (<anonymous>)
    at https://app.uniswap.org/static/js/main.411b0c26.chunk.js:1:166282
    at Object.Aa [as useMemo] (https://app.uniswap.org/static/js/35.a759c04b.chunk.js:2:1194683)
    at https://app.uniswap.org/static/js/35.a759c04b.chunk.js:2:1129703
    at sa (https://app.uniswap.org/static/js/main.411b0c26.chunk.js:1:166260)
    at https://app.uniswap.org/static/js/main.411b0c26.chunk.js:1:168423
    at ba (https://app.uniswap.org/static/js/main.411b0c26.chunk.js:1:168844)

Device data

{
  "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
  "browser": {
    "name": "Chrome",
    "version": "94.0.4606.81",
    "major": "94"
  },
  "engine": {
    "name": "Blink",
    "version": "94.0.4606.81"
  },
  "os": {
    "name": "Windows",
    "version": "10"
  },
  "device": {},
  "cpu": {
    "architecture": "amd64"
  }
}

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 by reproducing the swap URL and reviewing the recorded swap state. Trace the minified stack from sortsBefore in 35.a759c04b.chunk.js into the corresponding source behind main.411b0c26.chunk.js, then verify that this case no longer crashes and add or run a regression test if one is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.