# AssertionError: Route should be a string or a pathlib.Path

- **ID:** `python/starlette-route-order`
- **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. **** (90% success)
   ```
   添加路由时使用 '/path' 格式，例如 app.add_route('/home', home_page)
   ```
2. **** (70% success)
   ```
   from pathlib import Path; app.add_route(Path('/home'), home_page)
   ```

## Dead Ends

- **** — 路由必须是字符串路径，否则无法匹配。 (80% fail)
- **** — 断言错误会导致应用启动失败。 (100% fail)
