Skip to content

Agent Zero AI framework

more forgiving component path

frdel151900d294ce
diff --git a/webui/js/components.js b/webui/js/components.js
index 926c78e8d..16612662f 100644
--- a/webui/js/components.js
+++ b/webui/js/components.js
@@ -30,7 +30,8 @@ export async function importComponent(path, targetElement) {
targetElement.innerHTML = '<div class="loading"></div>';
// full component url
- const componentUrl = "components/" + path;
+ const trimmedPath = path.replace(/^\/+/, "");
+ const componentUrl = trimmedPath.startsWith("components/") ? trimmedPath : "components/" + trimmedPath;
// get html from cache or fetch it
let html;