[Vuejs]-Trying to get Prerender SPA Plugin to work on Vue.js CLI 3

0👍

Try adding headless: false to your renderer options. This will open a Chromium browser with your specified array of routes. Open the inspector in the Chromium browser and its very likely that you will see errors in the console.

0👍

Before everything please checkout your main.js file and add this created() to the main.js file

created() {
  document.dispatchEvent(new Event('render-event'));
}

Another possible issue with this configuration is that the renderAfterDocumentEvent property is set to ‘render-event’. This property specifies the event that the renderer should wait for before rendering the pre-rendered pages. If this event is not being emitted by your application, the renderer may not render the pre-rendered pages correctly.

if it didn’t work please change your path :

staticDir: path.resolve('dist'),

Leave a comment