# INFO: 127.0.0.1:xxxxx - "GET /static/style.css HTTP/1.1" 404 Not Found

- **ID:** `python/starlette-static-files-404`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

StaticFiles was mounted with a directory that does not exist relative to the process working directory, or the mount path and URL prefix disagree.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 0.30+ | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   from pathlib import Path
from fastapi.staticfiles import StaticFiles
BASE = Path(__file__).resolve().parent
app.mount('/static', StaticFiles(directory=BASE / 'static'), name='static')
   ```
2. **** (85% success)
   ```
   assert (BASE / 'static').is_dir(), 'static dir missing'
   ```

## Dead Ends

- **** — Bypasses StaticFiles caching and content-type handling; fragile. (80% fail)
- **** — Shadows API routes registered after the mount. (75% fail)
