I’m working on integrating the new Vue SDK. I’m using Nuxt server side rendering and I’m trying to get the Experience Manager overlay to work. I’m passing the page object to the component with the initialize function from the spa-sdk with the following config:
However, the preview in the Experience manager is still pointing to the production url of the resource manager instead of using _cmsinternal. Could this have something to do with the newly integrated rewrite rules in version 14.2?
Are you using UrlRewriter with the recommended configuration from our documentation?
The setup you are trying to configure is deprecated and will not work in the next major release. I would recommend using the latest approach without UrlRewriter. You can enable that as it is described here.
Then, the configuration should be like:
{
cmsBaseUrl: process.env.VUE_APP_CMS_BASE_URL
}
where VUE_APP_CMS_BASE_URL is http://localhost:8080/site.
@dokmic the above configuration change indeed helped. We do get, what seems te be very random, CORS errors. Sometimes it works, sometimes it fails.
Access to XMLHttpRequest at '.../site/resourceapi/' from origin 'VUE_APP_BASE_URL' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
While we do have this configured at the root mount in the hst:responseheaders.
Can you test it with browser caching disabled? I am curious whether
that helps since that might give us an idea what is wrong and how to
fix it. Thus the request returns from the cms domain but without the
right Access-Control-Allow-Origin set, right?