# ValueError: A route with the same path already exists.

- **ID:** `python/starlette-route-mount-conflict`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

在Starlette应用中重复注册相同路径的路由，导致冲突。

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **删除旧路由再注册新路由** (85% success)
   ```
   from starlette.routing import Route; routes = [route for route in app.routes if route.path != '/existing']; routes.append(Route('/existing', endpoint=new_handler)); app.router.routes = routes
   ```
2. **使用不同的路径或添加版本前缀** (95% success)
   ```
   app.add_route('/v2/existing', new_handler)
   ```

## Dead Ends

- **尝试覆盖路由而不删除旧路由** — 框架不允许重复注册。 (90% fail)
- **使用不同的HTTP方法但路径相同** — Starlette允许相同路径不同方法，但若方法也相同则冲突。 (50% fail)
