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 '//<pack>/index.js'. Browsers parse that as a protocol-relative URL and resolve '<pack>' 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 '<prefix>/' otherwise.
This commit is contained in:
parent
0a6a5d6aa9
commit
bac3101e4d
@ -39,8 +39,12 @@ if (!packName) {
|
|||||||
} else {
|
} else {
|
||||||
// Base prefix covers deployments behind a sub-path reverse proxy
|
// Base prefix covers deployments behind a sub-path reverse proxy
|
||||||
// ("/comfyui/extensions/<pack>/..." -> "/comfyui/"); the pack's own
|
// ("/comfyui/extensions/<pack>/..." -> "/comfyui/"); the pack's own
|
||||||
// static mount sits at "<base><pack>/".
|
// static mount sits at "<base><pack>/". For the standard deployment
|
||||||
const base = '/' + segments.slice(0, extensionsIndex).join('/') + '/';
|
// 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 "<pack>" 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
|
// Top-level await: extension scripts are awaited before ComfyUI registers
|
||||||
// node definitions, so the editor's registerExtension()/custom-widget
|
// node definitions, so the editor's registerExtension()/custom-widget
|
||||||
// hooks stay in the normal loading order.
|
// hooks stay in the normal loading order.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user