# ValueError: Route path must start with '/'

- **ID:** `python/starlette-route-error`
- **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. **** (95% success)
   ```
   确保所有路由路径以 '/' 开头，如 '/home'。
   ```
2. **** (90% success)
   ```
   使用 f-string 或拼接时注意开头。
   ```
3. **** (85% success)
   ```
   添加自动检查函数验证路径格式。
   ```

## Dead Ends

- **** — 忽略错误，不修改路径。 (80% fail)
- **** — 尝试在路径前加空格。 (60% fail)
- **** — 使用反斜杠而不是正斜杠。 (70% fail)
