Uniswap / Uniswap/interface

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

Open
#4,605 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://swap.keyring.app/#/swap?chain=mainnet

swap state

{
  "INPUT": {
    "currencyId": "ETH"
  },
  "OUTPUT": {
    "currencyId": null
  },
  "independentField": "INPUT",
  "typedValue": "",
  "recipient": null
}

Error

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

Stacktrace

TypeError: Cannot read properties of undefined (reading '0')
    at GI (https://swap.keyring.app/static/js/main.0a76b5e2.chunk.js:1:575829)
    at oo (https://swap.keyring.app/static/js/34.5b0b48ce.chunk.js:2:1806898)
    at Ho (https://swap.keyring.app/static/js/34.5b0b48ce.chunk.js:2:1816465)
    at Xf (https://swap.keyring.app/static/js/34.5b0b48ce.chunk.js:2:1860189)
    at Pu (https://swap.keyring.app/static/js/34.5b0b48ce.chunk.js:2:1846439)
    at Cu (https://swap.keyring.app/static/js/34.5b0b48ce.chunk.js:2:1846367)
    at Su (https://swap.keyring.app/static/js/34.5b0b48ce.chunk.js:2:1846230)
    at wu (https://swap.keyring.app/static/js/34.5b0b48ce.chunk.js:2:1843196)
    at https://swap.keyring.app/static/js/34.5b0b48ce.chunk.js:2:1792690
    at t.unstable_runWithPriority (https://swap.keyring.app/static/js/34.5b0b48ce.chunk.js:2:1869927)

Device data

{
  "ua": "Mozilla/5.0 (Linux; Android 9; CPH2083) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Mobile Safari/537.36",
  "browser": {
    "name": "Chrome",
    "version": "105.0.0.0",
    "major": "105"
  },
  "engine": {
    "name": "Blink",
    "version": "105.0.0.0"
  },
  "os": {
    "name": "Android",
    "version": "9"
  },
  "device": {
    "vendor": "OPPO",
    "model": "CPH2083",
    "type": "mobile"
  },
  "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 https://swap.keyring.app/#/swap?chain=mainnet using the reported swap state, then trace the stack from static/js/main.0a76b5e2.chunk.js and static/js/34.5b0b48ce.chunk.js. Done means the swap page no longer crashes when OUTPUT.currencyId is null and the reported state can be rendered safely.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.