# RepoSpace UI fix — blank white screen **Date:** 2026-10-02 (Europe/Berlin) **Space:** https://huggingface.co/spaces/2Btainment/repospace **App:** https://2btainment-repospace.hf.space ## Symptom Blank white page when opening session routes (`/space/{id}`), on refresh after Launch, or any deep link under `/space/…`. Landing `/` HTML/JS/CSS loaded; session URL returned JSON `{"detail":"Not found"}` (browser shows empty white). ## Root cause In `backend/app/main.py`, SPA fallback excluded paths with: ```python full_path.startswith(("api/", "api", "s/", "s", "docs", ...)) ``` `str.startswith("s")` is true for **`space/...`**, so the React route `/space/:id` never received `index.html`. Hard refresh / direct open → 404 JSON → white UI. Secondary: `/` and SPA routes only allowed `GET`, so `HEAD /` returned **405** (some probes/proxies use HEAD). Not the cause: Docker `COPY` of frontend dist, Vite asset paths, or missing CSS (assets returned 200). ## Fix 1. Match API/proxy by **first path segment** (`api`, `s`, `docs`, …) — never bare `startswith("s")`. 2. Register `/` and `/{full_path:path}` for **GET + HEAD**. 3. Regression tests in `backend/tests/test_spa_static.py`. ## Verify - `GET /space/abc` → 200 `text/html` with `#root` - `HEAD /` → 200 - `GET /assets/*.js|*.css` → 200 - `GET /api/health` → 200 - Space runtime `RUNNING` and visible dark UI (not white)