AlexsJones/llmfit · warning

llmfit-web dist assets not found; serving fallback page.

Error message

llmfit-web dist assets not found; serving fallback page.

What it means

This message is the JavaScript console.warn text embedded in llmfit-tui's fallback web assets (build.rs:94). When the llmfit-web/dist directory does not exist at cargo build time, build.rs emits `cargo:warning=llmfit-web/dist not found...` and generates a placeholder dashboard consisting of a single index.html plus fallback.js whose only behavior is this console.warn; the running binary then serves 'Frontend assets are missing' at the web dashboard route instead of the React app. It is a deliberate degradation path — the Rust build succeeds and the HTTP API works, only the embedded UI is a stub.

Source

Thrown at llmfit-tui/build.rs:94

    output.push_str("#[derive(Clone, Copy)]\n");
    output.push_str("pub(crate) struct EmbeddedAsset {\n");
    output.push_str("    pub(crate) path: &'static str,\n");
    output.push_str("    pub(crate) content_type: &'static str,\n");
    output.push_str("    pub(crate) bytes: &'static [u8],\n");
    output.push_str("}\n\n");
    output.push_str("const FALLBACK_INDEX_HTML: &[u8] = br#\"<!doctype html>\n");
    output.push_str("<html lang=\\\"en\\\">\n");
    output.push_str("  <head><meta charset=\\\"UTF-8\\\"/><meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1.0\\\"/><title>llmfit</title></head>\n");
    output.push_str("  <body style=\\\"font-family: sans-serif; padding: 24px\\\">\n");
    output.push_str("    <h1>llmfit Web Dashboard</h1>\n");
    output.push_str("    <p>Frontend assets are missing.</p>\n");
    output.push_str(
        "    <p>From repo root run: <code>cd llmfit-web && npm ci && npm run build</code></p>\n",
    );
    output.push_str("    <script src=\\\"/assets/fallback.js\\\"></script>\n");
    output.push_str("  </body>\n");
    output.push_str("</html>\"#;\n");
    output.push_str("const FALLBACK_JS: &[u8] = br\"console.warn('llmfit-web dist assets not found; serving fallback page.');\";\n\n");
    output.push_str("pub(crate) static EMBEDDED_WEB_ASSETS: &[EmbeddedAsset] = &[\n");
    output.push_str("    EmbeddedAsset { path: \"/index.html\", content_type: \"text/html; charset=utf-8\", bytes: FALLBACK_INDEX_HTML },\n");
    output.push_str("    EmbeddedAsset { path: \"/assets/fallback.js\", content_type: \"text/javascript; charset=utf-8\", bytes: FALLBACK_JS },\n");
    output.push_str("];\n");
    output
}

fn content_type_for_path(path: &Path) -> &'static str {
    match path.extension().and_then(|ext| ext.to_str()) {
        Some("html") => "text/html; charset=utf-8",
        Some("js") => "text/javascript; charset=utf-8",
        Some("css") => "text/css; charset=utf-8",
        Some("json") | Some("map") => "application/json; charset=utf-8",
        Some("svg") => "image/svg+xml",
        Some("png") => "image/png",
        Some("jpg") | Some("jpeg") => "image/jpeg",
        Some("gif") => "image/gif",
        Some("webp") => "image/webp",

View on GitHub (pinned to acc7e40c3a)

Solutions

  1. Build the frontend: from repo root run `cd llmfit-web && npm ci && npm run build`.
  2. Rebuild the Rust binary afterwards (`cargo build` or `cargo build -p llmfit`) — build.rs declares cargo:rerun-if-changed on llmfit-web/dist, so creating dist re-triggers embedding of the real assets.
  3. Verify `llmfit-web/dist/index.html` exists after the npm build before recompiling; if npm run build failed, fix the frontend error it reported.
  4. If you intentionally ship without the dashboard, treat the fallback page as expected and consume the JSON API at /api/v1/* directly.

Example fix

# before
cargo build   # dist/ missing → binary serves fallback page + console.warn

# after
cd llmfit-web && npm ci && npm run build && cd .. && cargo build
Defensive patterns

Strategy: validation

Validate before calling

# Before cargo build, assert the frontend artifacts exist (or build them).
test -f llmfit-web/dist/index.html || (cd llmfit-web && npm ci && npm run build)
cargo build

Prevention

When it happens

Trigger: Building llmfit-tui from a fresh clone without running the frontend build (`cargo build` before `npm ci && npm run build` in llmfit-web); building after `git clean -fdx` or an npm build failure removed dist; CI pipelines that compile only the Rust workspace, then someone opens the served dashboard at / and sees the fallback page with this warning in the browser console.

Common situations: New contributors skipping the web build step; release/CI pipelines split so the npm stage ran on a different agent than cargo; dist/ gitignored so archives/artifacts shipped without it; `llmfit serve` locally after a clean.

Related errors


AI-assisted analysis of AlexsJones/llmfit@acc7e40c3a (2026-08-17). Data as JSON: /api/errors/c362c7a5dde75d78. Report an issue: GitHub.