# werkzeug.routing.exceptions.BuildError: Could not build url for endpoint 'index'

- **ID:** `python/flask-url-build-error-endpoint`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The endpoint name is misspelled or the route does not exist.

## Version Compatibility

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

## Workarounds

1. **Check the defined routes and ensure the endpoint name is correct.** (90% success)
   ```
   print(app.url_map)  # List all routes and endpoints
   ```
2. **Use the correct endpoint name in url_for.** (95% success)
   ```
   url_for('home')  # Replace 'home' with the actual endpoint
   ```

## Dead Ends

- **Adding a random URL parameter to the url_for function.** — The endpoint still does not exist; parameters only work for existing routes. (80% fail)
- **Using the function name instead of the endpoint name incorrectly.** — If the endpoint is explicitly set, the function name may not match. (60% fail)
