diff --git a/plugin-designs/posterverse/posterverse.vue b/plugin-designs/posterverse/posterverse.vue index 3ee203f79..f1c5322e2 100644 --- a/plugin-designs/posterverse/posterverse.vue +++ b/plugin-designs/posterverse/posterverse.vue @@ -281,7 +281,9 @@ export default defineComponent({ // 2. /doxa-maps-spa/manifest.json, the byte-identical copy generate-tree writes for the // Research Gallery. The live static layer sends CORS headers only inside a tree folder, not // on the root manifest, so a partner page's script embed reads this copy FIRST; - // 3. /public//manifest.json, where the dev server keeps the built manifest. + // 3. //manifest.json, the built tree as the dev server serves it (at the ROOT). NOT /public//: + // the dev server treats a /public/… request as SOURCE and injects an import into each built IIFE, which + // then fails as a classic script ("Cannot use import statement outside a module"). // Script URLs always resolve against the tree ROOT, never the copy's folder. loadManifest() { const dirOf = (u) => { try { return new URL(u, location.href).href.replace(/[^/]*$/, '') } catch { return '' } } @@ -291,7 +293,7 @@ export default defineComponent({ let crossOrigin = false try { crossOrigin = new URL(rootUrl, location.href).origin !== location.origin } catch { /* relative = same */ } const candidates = crossOrigin ? [copy, root] : [root, copy] - const devFallback = '/public/' + __DOXA_TREE_NAME__ + '/manifest.json' + const devFallback = '/' + __DOXA_TREE_NAME__ + '/manifest.json' if (!candidates.some((c) => c.url === devFallback)) candidates.push({ url: devFallback, root: dirOf(devFallback) }) const tried = [] const attempt = (i) => {