Static GitHub Issues

[1928] meta data for social media not working in SPA

prev: Layout not loaded when page accessed directly
next: Still making requests after generate?

I have finished writing my application, but i am running into problems with meta data for social media sharing. Since all my page data is asynchroniously loaded via JSON file, Facebook has a hard time loaded that information. Is my only option to go the SSR way rather than a classic SPA?

I have attached a typical way that i update the meta data:

  async asyncData (context) {
    let { data } = await axios.get('/data/about.json')
    return { content: data }
  },
  head () {
    return initMetaData(this.content.seoMetaTags)
  }

The function initMetaData basically returns the meta information which is loaded.

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1720">#c1720</a>)</em></sub></div>