From bac3101e4d89bbc4342f681b6e07ece2cae5dc99 Mon Sep 17 00:00:00 2001 From: Z User Date: Tue, 29 Sep 2026 04:57:25 +0000 Subject: [PATCH] fix: editor loader built a protocol-relative URL on standard installs The base-prefix computation produced '//' when the loader is served from the top-level /extensions mount (the standard case), turning the editor import into '///index.js'. Browsers parse that as a protocol-relative URL and resolve '' as a DNS hostname, so the editor entry never loaded: console shows 'Failed to load resource: net::ERR_NAME_NOT_RESOLVED moxie-multimedia/index.js' followed by [vite:preloadError]. Only sub-path reverse-proxy deployments accidentally worked. Base is now exactly '/' when there is no sub-path prefix, and '/' otherwise. --- web/js/editor-loader.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/js/editor-loader.js b/web/js/editor-loader.js index 9d43f26..0f041b8 100644 --- a/web/js/editor-loader.js +++ b/web/js/editor-loader.js @@ -39,8 +39,12 @@ if (!packName) { } else { // Base prefix covers deployments behind a sub-path reverse proxy // ("/comfyui/extensions//..." -> "/comfyui/"); the pack's own - // static mount sits at "/". - const base = '/' + segments.slice(0, extensionsIndex).join('/') + '/'; + // static mount sits at "/". For the standard deployment + // there is no prefix and base is exactly "/" - it must NEVER be "//", + // which the browser would parse as a protocol-relative URL and try to + // resolve "" as a DNS hostname (net::ERR_NAME_NOT_RESOLVED). + const prefix = segments.slice(0, extensionsIndex); + const base = prefix.length ? '/' + prefix.join('/') + '/' : '/'; // Top-level await: extension scripts are awaited before ComfyUI registers // node definitions, so the editor's registerExtension()/custom-widget // hooks stay in the normal loading order.