# Access to fetch at 'http://localhost:5000/api' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

- **ID:** `python/flask-cors-preflight-failed`
- **Domain:** python
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Flask-CORS not installed/registered, or OPTIONS preflight not handled because route restricts methods.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   from flask_cors import CORS; CORS(app, resources={r'/api/*': {'origins': 'http://localhost:3000'}})
   ```
2. **** (85% success)
   ```
   Ensure route methods include OPTIONS: @app.route('/api', methods=['GET','POST','OPTIONS'])
   ```

## Dead Ends

- **** — Preflight OPTIONS still returns 405 before after_request runs. (65% fail)
- **** — CORS is server-controlled; client cannot bypass it. (90% fail)
