I've been experimenting with getting The
SPA Renderer Extended module to work.
My environment is Magnolia version 6.2.8 DX Core.
The module is installed as:
<dependency>
<groupId>info.magnolia.pages</groupId>
<artifactId>magnolia-spa-rendering-extended</artifactId>
<version>1.1</version>
</dependency>
My front end application is configured with:
const config = {
get appBase() { return `/${this.hostName}` },
get apiPages() { return `${this.mgnlAuthorUrl}/.rest/delivery/pages/v1` },
get apiPagesPreview() { return `${this.mgnlAuthorUrl}/.rest/preview/pages/v1` },
get apiTemplateDefinitions() { return `${this.mgnlAuthorUrl}/.rest/template-definitions/v1` },
componentMappings: {
'one-ds:pages/basic': Basic,
...
},
get hostName(){ return window.location.hostname },
isPreview: true,
languages: ['en', 'de'],
// TODO: parameterize from .env ?
get mgnlVersion() {
return new URLSearchParams(window.location.href).get('mgnlVersion');
},
staticWebResourcesPath: '/static'
}
CORS is configured in magnolia and when I visit my front-end application on a separate domain it renders as expected:
performs ajax request to
All is well.
Now on the Magnolia side in the Page template (basic.yaml) I have the following:
title: 'one-ds: Basic'
#renderType: spa
renderType: spaExtended
class: info.magnolia.rendering.spa.renderer.SpaRenderableDefinition
# I assume this points to the remote site?
dialog: one-ds:pages/basic
areas:
main:
title: Main Area
availableComponents:
...
extras:
title: Extras Area
availableComponents:
...
When I attempt to preview or edit the page though I receive a 500 error:
HTTP Status 500 – Internal Server Error
...
java.lang.RuntimeException: com.machinezoo.noexception.WrappedException: java.net.ConnectException: Connection refused (Connection refused)
...
Inspecting the Iframe wrapping the WYSIWYG, I see the following:
<iframe class="gwt-Frame" src="/site-1.local.html?mgnlPreview=false&mgnlChannel=desktop" ...>
That is not the url I expected. I was under the impression that this should be
From the documentation I can't tell if something is missing or not.
I assumed it was as straightforward as:
1. the font-end code referencing the magnolia server (confirmed to work)
2. The backend referencing the front-end for WYSIWYG rendering (not working)
Is there something obvious I'm missing?