Crash report: `TypeError: s.flatMap is not a function`
Open
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.factorychain.io/#/swap?outputCurrency=0x8409cb3b54104ce63f7942a1403cc12c7e68b64e
swap state
{
"independentField": "INPUT",
"typedValue": "",
"INPUT": {
"currencyId": null
},
"OUTPUT": {
"currencyId": null
},
"recipient": null
}
Error
TypeError: s.flatMap is not a function
Stacktrace
TypeError: s.flatMap is not a function
at https://swap.factorychain.io/static/js/main.f5c03036.chunk.js:1:176187
at Object.useMemo (https://swap.factorychain.io/static/js/3.b9a5ba8e.chunk.js:2:1660526)
at push.t.useMemo (https://swap.factorychain.io/static/js/3.b9a5ba8e.chunk.js:2:1578796)
at Fs (https://swap.factorychain.io/static/js/main.f5c03036.chunk.js:1:176165)
at ud (https://swap.factorychain.io/static/js/main.f5c03036.chunk.js:1:182816)
at push.790.S.maxHops (https://swap.factorychain.io/static/js/main.f5c03036.chunk.js:1:184943)
at md (https://swap.factorychain.io/static/js/main.f5c03036.chunk.js:1:185337)
at rC (https://swap.factorychain.io/static/js/main.f5c03036.chunk.js:1:583097)
at oo (https://swap.factorychain.io/static/js/3.b9a5ba8e.chunk.js:2:1654561)
at Wf (https://swap.factorychain.io/static/js/3.b9a5ba8e.chunk.js:2:1706861)
Device data
{
"ua": "Mozilla/5.0 (Linux; Android 11; SM-A515F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.152 Mobile Safari/537.36",
"browser": {
"name": "Chrome",
"version": "88.0.4324.152",
"major": "88"
},
"engine": {
"name": "Blink",
"version": "88.0.4324.152"
},
"os": {
"name": "Android",
"version": "11"
},
"device": {
"vendor": "Samsung",
"model": "SM-A515F",
"type": "mobile"
},
"cpu": {}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the crash at the reported swap URL using the supplied swap state, then trace the minified main.f5c03036.chunk.js stack around Fs, maxHops, and the useMemo call. Confirm the underlying source location and add coverage or a fix so this URL no longer throws the reported TypeError.
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
- 20/100