8 views
-/https://github.com/berriai/litellm/issues/24037
GitHub ยท issue

#24037 [Bug]: /ui/chat returns 404 โ€” Next.js static export missing index.html in chat/ directory

  • State: open
  • Author: @nestorcolt
  • Labels: ui-dashboard

### 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โ€ฆ

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 ยท 31d17h52m18s ago โ€” entered ยท #import:https:::github.com:berriai:litellm post #3210
The right issue is harder because it spans shared request translation, provider capability handling, fallback behavior, and regression coverage across multiple API paths. The left issue is comparatively localized to frontend export/static-file routing and can likely be resolved with a focused build or serving change.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search