No routes matched ⚛️ React

No routes matched location "/x"

React Router found no route definition for the current URL.

Seen on: React

Meaning

Path typos, missing nested route outlets, or a basename mismatch when the app is served from a sub-path. Refreshing deep links can also 404 at the server level.

Common causes

  • No matching <Route path>
  • Missing <Outlet /> for nested routes
  • basename not set for sub-path deploys
  • Trailing slash/case differences

⚡ Quick fix

  1. Add a catch-all route: path="*"
  2. Set basename on the router
  3. Render <Outlet /> in parent layouts

Detailed fix by platform

React

  1. <Route path="*" element={<NotFound />} />

How to diagnose

  1. URL — Which path?
  2. Routes — What paths are defined?

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.