#24037 [Bug]: /ui/chat returns 404 โ Next.js static export missing index.html in chat/ directory
### Check for existing issues
- [x] I have searched the existing issues and checked that my issue is not a duplicate.
### What happened?
Direct navigation to `/ui/chat` (or any UI sub-route like `/ui/logs`, `/ui/models-and-endpoints`) returns `{"detail":"Not Found"}` (HTTP 404). The UI root `/ui/` works fine, and client-side SPA navigation from the sidebar works โ only direct URL access to sub-routes is broken.
### Root Cause Analysis
The `/ui` mount uses Starlette `StaticFiles(directory=..., html=True)`. The Next.js static export creates both `chat.html` and a `chat/` directory (containing RSC data files like `__next.chat.__PAGE__.txt`), but **no `chat/index.html`** inside the directory.
**Starlette's StaticFiles resolution for path `chat`:** 1. `lookup_path('chat')` โ finds the `chat/` **directory** โ `stat.S_ISDIR = True` 2. Since `html=True` and it's a directory โ looks for `chat/index.html` 3. `chat/index.html` does not exist โ **404** 4. `chat.html` exists but is never tried because the directory match takes priority
**Contents of `_experimental/out/chat/`:** ``` __next._full.txt __next._head.txt __next._index.txt __next._tree.txt __next.chat.__PAGE__.txt __next.chat.tโฆ