S
S
Shurik2021-02-20 14:43:44
webpack
Shurik, 2021-02-20 14:43:44

Why is vue prerender-spa-plugin not rendering content from the backend?

Hello. I want to generate several static pages for the vue application in order to feed them to Yandex, for this I use the prerender-spa-plugin.
I did it in different ways: according to the instructions and the video on YouTube, where the dude also did it a little differently, relying on the documentation. But in neither case did I get pre-rendering. Well, it doesn’t start, the page seems to be pre-rendered, but in the code there is some kind of standard vue template, without content from the backend.
It feels like data is not being received from the backend, although the proxy is configured. Maybe it's because the project is in docker? What are the nuances, can anyone come across a similar one?
Here is what my prerender generates:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <link rel="icon" href="/dist/favicon.ico">
    <title>My app</title>
  <link href="/dist/css/about.css" rel="prefetch"><link href="/dist/js/about.js" rel="prefetch"><link href="/dist/css/app.css" rel="preload" as="style"><link href="/dist/css/chunk-vendors.css" rel="preload" as="style"><link href="/dist/js/app.js" rel="preload" as="script"><link href="/dist/js/chunk-vendors.js" rel="preload" as="script"><link href="/dist/css/chunk-vendors.css" rel="stylesheet"><link href="/dist/css/app.css" rel="stylesheet"></head>
  <body>
    <noscript>
      <strong>We're sorry but Listtok doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  <script type="text/javascript" src="/dist/js/chunk-vendors.js"></script><script type="text/javascript" src="/dist/js/app.js"></script></body>
</html>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question