# werkzeug.routing.exceptions.BuildError: 无法为端点 'user_detail' 构建 URL，是否想用 'user_detial'？

- **ID:** `python/werkzeug-build-error-endpoint`
- **领域:** python
- **类别:** runtime_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

url_for() 引用了未注册的端点名称，或缺少/命名错误的必需 URL 参数。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.0.x | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   Verify endpoint name: `print(app.url_map)` and use the exact function name or `blueprint.function_name`.
   ```
2. **** (90% 成功率)
   ```
   Pass all required params: `url_for('user_detail', user_id=user.id)` matching the route `<int:user_id>`.
   ```

## 无效尝试

- **** — Breaks when routes change; loses blueprint prefixes and URL-encoding. (80% 失败率)
- **** — Does not fix unknown endpoint; still raises BuildError. (90% 失败率)
