Hash fragment redirects trigger “Something went wrong” error on Uniswap web landing page
Open
Beginner friendly
Nobody has claimed this yet.
bug
- Dominant language
- TypeScript
- Stars
- 5.5k
- Forks
- 5.4k
- PR merge metrics
- No merged PRs in 30d
Description
Interface Affected
- Web (app.uniswap.org)
App Version
- Version: Production build (hash-router landing logic)
- Production build
System / Environment Info
- Browser: All browsers
Steps to Reproduce
- Open
https://app.uniswap.org/#//example.orgin a clean browser session. - Allow the landing page to finish loading.
- A "Something went wrong" modal appears with a
SecurityErrorstack trace.
Expected Behavior
Ignore external-looking hash fragments or redirect only to internal routes without raising errors.
Actual Behavior
- Fragment is passed to React Router's
<Navigate>. - Router calls
history.replaceState('https://example.org/'); the browser rejects it withSecurityError. - User stays on
app.uniswap.orgbut sees the error overlay until reload.
Screenshots or Screen Recording
Screenshot available showing the "Something went wrong" overlay with the SecurityError stack trace.
Additional Context
- Logic lives in
apps/web/src/pages/RouteDefinitions.tsxvia<Navigate to={args.hash.replace('#', '')} />. - Sanitising fragments (e.g., require a leading
/) preserves legacy hashes like#/swapwhile avoiding the error. - No cross-origin redirect occurs; the issue is limited to a user-visible error state.
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
Start in apps/web/src/pages/RouteDefinitions.tsx, focusing on the hash-based logic described in the issue. Reproduce the URL with an external-looking fragment in a clean browser session, then verify that internal hashes such as #/swap still work and the external-looking fragment no longer produces a SecurityError overlay.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100