Spaces:
Paused
Download UI-FIX.md from 2Btainment/repospace: direct link, hf CLI and curl.
- Browser
- Download file 1.42 kB
-
https://huggingface.co/spaces/2Btainment/repospace/resolve/main/UI-FIX.md
- Command line
-
hf download hf://spaces/2Btainment/repospace/UI-FIX.md
-
curl -L -o UI-FIX.md https://huggingface.co/spaces/2Btainment/repospace/resolve/main/UI-FIX.md
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:
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
- Match API/proxy by first path segment (
api,s,docs, β¦) β never barestartswith("s"). - Register
/and/{full_path:path}for GET + HEAD. - Regression tests in
backend/tests/test_spa_static.py.
Verify
GET /space/abcβ 200text/htmlwith#rootHEAD /β 200GET /assets/*.js|*.cssβ 200GET /api/healthβ 200- Space runtime
RUNNINGand visible dark UI (not white)