Uniswap / Uniswap/interface

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

Open
#3,246 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/0xdAC17F958D2ee523a2206206994597C13D831ec7/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.411b0c26.chunk.js:1:427942
    at Array.reduce (<anonymous>)
    at https://app.uniswap.org/static/js/main.411b0c26.chunk.js:1:427866
    at Object.Aa [as useMemo] (https://app.uniswap.org/static/js/35.a759c04b.chunk.js:2:1194683)
    at t.useMemo (https://app.uniswap.org/static/js/35.a759c04b.chunk.js:2:1129703)
    at https://app.uniswap.org/static/js/main.411b0c26.chunk.js:1:427503
    at Pg (https://app.uniswap.org/static/js/main.411b0c26.chunk.js:1:428828)
    at pv (https://app.uniswap.org/static/js/main.411b0c26.chunk.js:1:434543)
    at ua (https://app.uniswap.org/static/js/35.a759c04b.chunk.js:2:1189950)
    at Ha (https://app.uniswap.org/static/js/35.a759c04b.chunk.js:2:1199517)

Device data

{
  "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.81 Safari/537.36",
  "browser": {
    "name": "Chrome",
    "version": "98.0.4758.81",
    "major": "98"
  },
  "engine": {
    "name": "Blink",
    "version": "98.0.4758.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

Reproduce the reported URL with the supplied mintV3 state and inspect the source corresponding to the main.411b0c26.chunk.js stack frames, especially the useMemo/reduce path. Trace the undefined value behind the reported array access and add a regression test if the relevant test location is found; done means the add-liquidity flow no longer crashes for this state.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
blockchain, 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.