question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

i used prerender-spa-plugin and i get a .html , but can't include data which i requrest

See original GitHub issue
new PrerenderSpaPlugin({
            staticDir: path.join(__dirname,'./dist'),
            indexPath: path.join(__dirname, 'dist', 'index.html'),
            routes: ['/','/hotNews','/findNews'],
            // 定时捕获
            renderer: new Renderer({
                renderAfterTime: 5000,
                // 监听到自定事件时捕获
                captureAfterDocumentEvent: 'custom-post-render-event'
            })
                // document.dispatchEvent(new Event('custom-post-render-event'))

                // 查询到指定元素时捕获
                // captureAfterElementExists: '#content',

        })
<body>
    <div id="app"><div data-v-fed36922="" class="homePage"><header data-v-f425c67e="" data-v-fed36922="" class="navBar"><nav data-v-fed36922="" data-v-f425c67e="" class="nav-til"><a data-v-fed36922="" data-v-f425c67e="" href="javascript:" class="nav-item">沸点</a><a data-v-fed36922="" data-v-f425c67e="" href="javascript:" class="nav-item active-item">发现</a> <span data-v-fed36922="" data-v-f425c67e="" class="nav-border" style="left: 400px;"></span></nav></header> <section data-v-41d22626="" data-v-fed36922="" class="hot"><ul data-v-41d22626=""></ul></section> <footer data-v-51d2507f="" data-v-fed36922=""><div data-v-fed36922="" data-v-51d2507f="">
        prerender测试
      </div></footer></div></div>
<script type="text/javascript" src="/bundle.js"></script>
</body>

just static data no request data0 0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14

github_iconTop GitHub Comments

2reactions
JoshTheDerfcommented, Apr 10, 2018

@chentianyuan Oooh, it’s because prerender-spa-plugin doesn’t use webpack-dev-server. It loads the files directly, so there is no API proxy when it prerenders.

1reaction
chentianyuancommented, Apr 10, 2018

ok ,maybe i can making a nginx conf outside to solve my proxy problem 。thankyou very much @Tribex , you are a good man .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Build failing using prerender-spa-plugin #312 - GitHub
Build fails when I attempt to npm run build when using prerender-spa-plugin. It looks like I'm facing pretty much the same issue described ......
Read more >
javascript - Webpack prerender-spa-plugin with compression ...
html is correctly gzipped. However, the resulting index.html (the page that is the result of the prerendering) is not gzipped. How can I...
Read more >
The easiest way to improve your Vue.js application. Part 1
Prerendering is a process to preload all elements on the page and generate the static HTML of your Single Page Application. Advantages of ......
Read more >
Setup prerender on webpack with prerender-spa-plugin, Part 1
SSR - gathers page's required data and creates an HTML right on client request Prerender - creates an HTML page early by running...
Read more >
prerender-spa-plugin - Bountysource
I'm having some issue that I can't solve with the current options. I have a "cookie consent" script, but this scripts renders some...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found