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.

Dynamic data not rendering

See original GitHub issue

prerender-spa-plugin 3.x webpack 4.x

after all the other issues about dynamic data,request data,dynamic content, e.g #178 i still can’t slove my problem…

my code

webpack.config

new PrerenderSpaPlugin({
    staticDir: path.resolve(__dirname, '../dist'),
    routes: ['', '/home', '/about'],
    render: new Renderer({
      renderAfterTime: 5000,
      headless: true,
      renderAfterDocumentEvent: 'render-event'
    })
  })

page code

mounted () {
      // this.$nextTick(() => {
        axios.get('https://api.github.com/users/lz82')
        .then(res => {
          this.pic = res.data.avatar_url
          this.url = res.data.url
          this.$nextTick(() => {
            document.dispatchEvent(new Event('render-event'))
          })
        })
      // })
    }

dist file

but there is only container is static html file but not dynamic data.

 <div id="app"><div data-v-68d85562="" class="container"><img data-v-68d85562="" src="" alt="">
  url:
</div></div>

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
lz82commented, Sep 14, 2018

@chentianyuan thx your help~ i’ve tried remove $nextTick before emmit new Event('render-event'), it doesn’t work…

but when i use renderAfterTime: 5000, it works.
if your project is using renderAfterDocumentEvent, can u push it to your repo? 😃

thank @Tribex help~

0reactions
chentianyuancommented, Sep 14, 2018

@chentianyuan 😭 i tried both renderer & Renderer, but, still doesn’t work…

try to remove the $nextTick,it seems to that prerender is async,and will execute after dom refresh

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dynamic data not rendering in builder - Bugs
I have just tried the query loop. When I add dynamic data the builder doesn't render Heading and Basic Text for the first...
Read more >
Dynamic data are not rendering on the browser - Stack Overflow
Good day, I'm trying to create a MEARN stack application with react-redux. I am already able to post data to my MongoDB atlas,...
Read more >
Why Dynamic Rendering Is Not a Long-Term Solution | Onely
Dynamic rendering is a workaround and not a long-term solution for JavaScript issues, and; Google recommends using server-side rendering, ...
Read more >
Dynamic Rendering | Google Search Central | Documentation
Dynamic rendering is a workaround for websites where JavaScript-generated content is not available to search engines. A dynamic rendering server detects bots ...
Read more >
Dynamic component loader - Angular
Instead, you need a way to load a new component without a fixed reference to the ... for dynamic components because it doesn't...
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