Uniswap / Uniswap/interface

Crash report: `TypeError: Cannot read properties of undefined (reading '0')`

Open
#3,525 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.5k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

URL

https://app.uniswap.org/#/add/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48/0xa693b19d2931d498c5b318df961919bb4aee87a5/3000

mintV3 state

{
  "independentField": "CURRENCY_A",
  "typedValue": "",
  "startPriceTypedValue": "",
  "leftRangeTypedValue": "0.873593",
  "rightRangeTypedValue": "1.613366"
}

Error

TypeError: Cannot read properties of undefined (reading '0')

Stacktrace

TypeError: Cannot read properties of undefined (reading '0')
    at https://app.uniswap.org/static/js/main.cb61304d.chunk.js:1:435718
    at Array.reduce (<anonymous>)
    at https://app.uniswap.org/static/js/main.cb61304d.chunk.js:1:435642
    at Object.Aa [as useMemo] (https://app.uniswap.org/static/js/35.a4ea1615.chunk.js:2:1661714)
    at t.useMemo (https://app.uniswap.org/static/js/35.a4ea1615.chunk.js:2:1581186)
    at https://app.uniswap.org/static/js/main.cb61304d.chunk.js:1:435279
    at Vg (https://app.uniswap.org/static/js/main.cb61304d.chunk.js:1:436600)
    at gv (https://app.uniswap.org/static/js/main.cb61304d.chunk.js:1:442281)
    at ia (https://app.uniswap.org/static/js/35.a4ea1615.chunk.js:2:1656981)
    at za (https://app.uniswap.org/static/js/35.a4ea1615.chunk.js:2:1666548)

Device data

{
  "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36",
  "browser": {
    "name": "Chrome",
    "version": "98.0.4758.102",
    "major": "98"
  },
  "engine": {
    "name": "Blink",
    "version": "98.0.4758.102"
  },
  "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 crash at the supplied app.uniswap.org URL with the recorded mintV3 state and inspect the reported minified main chunk stack trace. Trace the Array.reduce and useMemo locations back to source, then verify that this state no longer throws the TypeError.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.