Uniswap / Uniswap/interface

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

Open
#3,631 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/ETH/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48

mintV3 state

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

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.44a3bb87.chunk.js:1:402078
    at Array.reduce (<anonymous>)
    at https://app.uniswap.org/static/js/main.44a3bb87.chunk.js:1:402002
    at Object.Ta [as useMemo] (https://app.uniswap.org/static/js/4.ab98f63c.chunk.js:2:1764876)
    at t.useMemo (https://app.uniswap.org/static/js/4.ab98f63c.chunk.js:2:1684348)
    at https://app.uniswap.org/static/js/main.44a3bb87.chunk.js:1:401639
    at _g (https://app.uniswap.org/static/js/main.44a3bb87.chunk.js:1:402960)
    at Xg (https://app.uniswap.org/static/js/main.44a3bb87.chunk.js:1:405353)
    at ia (https://app.uniswap.org/static/js/4.ab98f63c.chunk.js:2:1760143)
    at za (https://app.uniswap.org/static/js/4.ab98f63c.chunk.js:2:1769710)

Device data

{
  "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36",
  "browser": {
    "name": "Chrome",
    "version": "99.0.4844.74",
    "major": "99"
  },
  "engine": {
    "name": "Blink",
    "version": "99.0.4844.74"
  },
  "os": {
    "name": "Mac OS",
    "version": "10.15.7"
  },
  "device": {},
  "cpu": {}
}

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

Reproduce the crash at the supplied add-liquidity URL using the recorded mintV3 state, then trace the minified stack through the useMemo and Array.reduce call sites to locate the source entry point. Done means this URL and state no longer throw the reported TypeError, with coverage for the failing case if the project’s existing tests support it.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.