nuxt / vue-meta

Manage HTML metadata in Vue.js components with SSR support
https://vue-meta.nuxtjs.org
Other
4.08k stars 247 forks source link

Prerendering instead of ssr #134

Closed anaelbe closed 5 years ago

anaelbe commented 7 years ago

Since i can't use SSR, i tried to use vue-meta with the spa-prerender one, which doesn't seems get along well. While being in dev mode, metas are injected properly, but when running build, assets are generated without errors, but also without any meta injection.

Any known issues on issues with PhantomJS ?

sanderfish commented 7 years ago

I would like to know more about using vue-meta in combination with prerender-spa-plugin as well.

Disclaimer: I have yet to try it out myself.

hofman-p commented 7 years ago

Yes, an answer would be very nice about this

Felwin commented 6 years ago

Just did it, works fine, just need a little tweaking. As vue-meta is working asynchronously you need to pass Phantom options in order to prerender that correctly. I just need the title and the description; description was not set on parent component (App.vue) but only on child (home, contact etc.) so it was quite easy, I added : captureAfterElementExists: "meta[name='description']" and it works great.

For more complex things I guess you would need to use an event adding to prerender-spa-plugin phantom options : captureAfterDocumentEvent: 'custom-post-render-event', and creating the 'custom-post-render-event' using changed() in vue-meta

devmattrick commented 6 years ago

I'm also having some issues with this. When not codesplitting routes, it works perfectly fine for me, but when adding a split point per route, any vue-meta information that is passed doesn't seem to get picked up by prerender-spa-plugin.

manniL commented 5 years ago

Stale. Please ping/answer here if the issue persists.