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
- Add a catch-all route: path="*"
- Set basename on the router
- Render <Outlet /> in parent layouts
Detailed fix by platform
React
<Route path="*" element={<NotFound />} />
How to diagnose
- URL — Which path?
- 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026