Uniswap / Uniswap/interface

Crash report: `SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.`

Open
#2,727 3 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/#/swap?outputCurrency=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2&theme=light&exactAmount=216.247&exactField=output

swap state

{
  "INPUT": {
    "currencyId": null
  },
  "OUTPUT": {
    "currencyId": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
  },
  "independentField": "OUTPUT",
  "typedValue": "216.247",
  "recipient": null
}

Error

SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.

Stacktrace

Error: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
    at t.getCachedUrl (https://app.uniswap.org/static/js/35.d35d34a0.chunk.js:2:984273)
    at https://app.uniswap.org/static/js/35.d35d34a0.chunk.js:2:985202
    at Fs (https://app.uniswap.org/static/js/35.d35d34a0.chunk.js:2:1393435)
    at t.unstable_runWithPriority (https://app.uniswap.org/static/js/35.d35d34a0.chunk.js:2:1411214)
    at Gi (https://app.uniswap.org/static/js/35.d35d34a0.chunk.js:2:1333754)
    at Rs (https://app.uniswap.org/static/js/35.d35d34a0.chunk.js:2:1392896)
    at https://app.uniswap.org/static/js/35.d35d34a0.chunk.js:2:1392807
    at L (https://app.uniswap.org/static/js/35.d35d34a0.chunk.js:2:1410273)
    at MessagePort.k.port1.onmessage (https://app.uniswap.org/static/js/35.d35d34a0.chunk.js:2:1408995)

Device data

{
  "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36",
  "browser": {
    "name": "Chrome",
    "version": "95.0.4638.54",
    "major": "95"
  },
  "engine": {
    "name": "Blink",
    "version": "95.0.4638.54"
  },
  "os": {
    "name": "Mac OS",
    "version": "10.15.5"
  },
  "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

Start by reproducing the crash from the reported swap URL and inspect the minified stack entry at static/js/35.d35d34a0.chunk.js, especially getCachedUrl. Trace how the application accesses localStorage when browser access is denied; done means the swap page no longer crashes in that condition and the reported error is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.