# AssertionError: View function mapping is overwriting an existing endpoint function: index

- **ID:** `python/flask-abort-assertion-error`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Multiple route decorators applied to the same function name or a view function registered twice with the same endpoint name.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   Specify different endpoint names in each decorator: @app.route('/a', endpoint='a_func') and @app.route('/b', endpoint='b_func')
   ```
2. **** (90% success)
   ```
   Use unique function names for each route: def index_a(): return 'A' and def index_b(): return 'B'
   ```

## Dead Ends

- **** — The endpoint defaults to the function name; if the path is the same, Flask still sees a conflict if the old function isn't removed. (60% fail)
- **** — Flask uses the function name as the endpoint by default, causing overwrite unless explicit endpoint is given. (80% fail)
