From 03f56d3c307b67119f2957dc9c3352368a9880b4 Mon Sep 17 00:00:00 2001 From: jmorganca Date: Sat, 7 Feb 2026 15:15:53 -0800 Subject: [PATCH] fix: allow app to build without UI dist directory Add a placeholder README.md in app/ui/app/dist so the go:embed directive doesn't fail when the UI hasn't been built. Also improve the error message when index.html is not found to help developers understand they need to run 'npm run build'. --- app/ui/app.go | 5 ++++- app/ui/app/dist/README.md | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 app/ui/app/dist/README.md diff --git a/app/ui/app.go b/app/ui/app.go index d73df2c02..c30b34454 100644 --- a/app/ui/app.go +++ b/app/ui/app.go @@ -33,7 +33,10 @@ func (s *Server) appHandler() http.Handler { data, err := fs.ReadFile(fsys, "index.html") if err != nil { if errors.Is(err, fs.ErrNotExist) { - http.NotFound(w, r) + // Development mode: UI not built + w.Header().Set("Content-Type", "text/plain") + w.WriteHeader(http.StatusNotFound) + w.Write([]byte("UI not built. Run 'npm run build' in app/ui/app directory.")) } else { http.Error(w, "Internal Server Error", http.StatusInternalServerError) } diff --git a/app/ui/app/dist/README.md b/app/ui/app/dist/README.md new file mode 100644 index 000000000..468773052 --- /dev/null +++ b/app/ui/app/dist/README.md @@ -0,0 +1 @@ +This directory contains the built React app. Run `npm run build` in the app directory to generate the build.