From c9910d4a661dd67be0fadf983d052a8e9b8277c8 Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Sun, 15 Mar 2026 18:01:55 +0800 Subject: [PATCH] fix(dashboard): add early check for missing index.html to prevent 404s --- astrbot/dashboard/server.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/astrbot/dashboard/server.py b/astrbot/dashboard/server.py index 7fa50fa1b..8c5734182 100644 --- a/astrbot/dashboard/server.py +++ b/astrbot/dashboard/server.py @@ -111,6 +111,12 @@ class AstrBotDashboard: else: self.data_path = os.path.abspath(user_dist) + if self.enable_webui and not (Path(self.data_path) / "index.html").exists(): + raise RuntimeError( + f"Dashboard static assets not found: index.html is missing in {self.data_path}. " + "Please run the WebUI build step." + ) + def _init_app(self): """初始化 Quart 应用""" global APP