interface icon indicating copy to clipboard operation
interface copied to clipboard

Hash fragment redirects trigger “Something went wrong” error on Uniswap web landing page

Open 5m477 opened this issue 2 months ago • 0 comments

Interface Affected


App Version

  • Version: Production build (hash-router landing logic)
  • [x] Production build

System / Environment Info

  • Browser: All browsers

Steps to Reproduce

  1. Open https://app.uniswap.org/#//example.org in a clean browser session.
  2. Allow the landing page to finish loading.
  3. A "Something went wrong" modal appears with a SecurityError stack 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 with SecurityError.
  • User stays on app.uniswap.org but sees the error overlay until reload.

Screenshots or Screen Recording

Screenshot available showing the "Something went wrong" overlay with the SecurityError stack trace.

Image

Additional Context

  • Logic lives in apps/web/src/pages/RouteDefinitions.tsx via <Navigate to={args.hash.replace('#', '')} />.
  • Sanitising fragments (e.g., require a leading /) preserves legacy hashes like #/swap while avoiding the error.
  • No cross-origin redirect occurs; the issue is limited to a user-visible error state.

5m477 avatar Nov 11 '25 14:11 5m477