{"record":{"id":"c362c7a5dde75d78","repo":"AlexsJones/llmfit","slug":"llmfit-web-dist-assets-not-found-serving-fallback","errorCode":null,"errorMessage":"llmfit-web dist assets not found; serving fallback page.","messagePattern":"llmfit-web dist assets not found; serving fallback page\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"llmfit-tui/build.rs","lineNumber":94,"sourceCode":"    output.push_str(\"#[derive(Clone, Copy)]\\n\");\n    output.push_str(\"pub(crate) struct EmbeddedAsset {\\n\");\n    output.push_str(\"    pub(crate) path: &'static str,\\n\");\n    output.push_str(\"    pub(crate) content_type: &'static str,\\n\");\n    output.push_str(\"    pub(crate) bytes: &'static [u8],\\n\");\n    output.push_str(\"}\\n\\n\");\n    output.push_str(\"const FALLBACK_INDEX_HTML: &[u8] = br#\\\"<!doctype html>\\n\");\n    output.push_str(\"<html lang=\\\\\\\"en\\\\\\\">\\n\");\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\");\n    output.push_str(\"  <body style=\\\\\\\"font-family: sans-serif; padding: 24px\\\\\\\">\\n\");\n    output.push_str(\"    <h1>llmfit Web Dashboard</h1>\\n\");\n    output.push_str(\"    <p>Frontend assets are missing.</p>\\n\");\n    output.push_str(\n        \"    <p>From repo root run: <code>cd llmfit-web && npm ci && npm run build</code></p>\\n\",\n    );\n    output.push_str(\"    <script src=\\\\\\\"/assets/fallback.js\\\\\\\"></script>\\n\");\n    output.push_str(\"  </body>\\n\");\n    output.push_str(\"</html>\\\"#;\\n\");\n    output.push_str(\"const FALLBACK_JS: &[u8] = br\\\"console.warn('llmfit-web dist assets not found; serving fallback page.');\\\";\\n\\n\");\n    output.push_str(\"pub(crate) static EMBEDDED_WEB_ASSETS: &[EmbeddedAsset] = &[\\n\");\n    output.push_str(\"    EmbeddedAsset { path: \\\"/index.html\\\", content_type: \\\"text/html; charset=utf-8\\\", bytes: FALLBACK_INDEX_HTML },\\n\");\n    output.push_str(\"    EmbeddedAsset { path: \\\"/assets/fallback.js\\\", content_type: \\\"text/javascript; charset=utf-8\\\", bytes: FALLBACK_JS },\\n\");\n    output.push_str(\"];\\n\");\n    output\n}\n\nfn content_type_for_path(path: &Path) -> &'static str {\n    match path.extension().and_then(|ext| ext.to_str()) {\n        Some(\"html\") => \"text/html; charset=utf-8\",\n        Some(\"js\") => \"text/javascript; charset=utf-8\",\n        Some(\"css\") => \"text/css; charset=utf-8\",\n        Some(\"json\") | Some(\"map\") => \"application/json; charset=utf-8\",\n        Some(\"svg\") => \"image/svg+xml\",\n        Some(\"png\") => \"image/png\",\n        Some(\"jpg\") | Some(\"jpeg\") => \"image/jpeg\",\n        Some(\"gif\") => \"image/gif\",\n        Some(\"webp\") => \"image/webp\",","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/AlexsJones/llmfit/blob/acc7e40c3a0afbd36510a92f2f8f3d5177cfc0fe/llmfit-tui/build.rs#L76-L112","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Build the frontend: from repo root run `cd llmfit-web && npm ci && npm run build`.","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.","Verify `llmfit-web/dist/index.html` exists after the npm build before recompiling; if npm run build failed, fix the frontend error it reported.","If you intentionally ship without the dashboard, treat the fallback page as expected and consume the JSON API at /api/v1/* directly."],"exampleFix":"# before\ncargo build   # dist/ missing → binary serves fallback page + console.warn\n\n# after\ncd llmfit-web && npm ci && npm run build && cd .. && cargo build","handlingStrategy":"validation","validationCode":"# Before cargo build, assert the frontend artifacts exist (or build them).\ntest -f llmfit-web/dist/index.html || (cd llmfit-web && npm ci && npm run build)\ncargo build","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make `npm --prefix llmfit-web run build` a required step before cargo build in release/CI pipelines.","Watch for the cargo:warning=llmfit-web/dist not found line during compilation — it is the build-time signal for this fallback.","Keep llmfit-web/dist out of .gitignore exceptions you rely on when packaging; verify the served dashboard after every release build.","If shipping without the dashboard intentionally, smoke-test the /api/v1/* endpoints instead of the UI."],"tags":["build-script","npm","frontend-assets","embedded-assets","fallback"],"backgroundTag":"missing-build-artifact","analyzedSha":"acc7e40c3a0afbd36510a92f2f8f3d5177cfc0fe","analyzedAt":"2026-08-17T10:35:29.658Z","contentChangedAt":"2026-08-17T10:35:29.658Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}