using vue-head with prerender-spa-plugin is causing title and meta tags to be displayed twice on netlify

流过昼夜 提交于 2019-12-24 11:54:03

问题


This issue only happens when live on netlify ( despite their prerender option turned off ), not while being served locally.

the live site shows :

<title>about | anonplayer about | anonplayer</title>

title and meta tags are set using the vue-head package like so

  head: {  
    title: {
      inner: "about | anonplayer",
      separator: ' ',
    }, ...

and this happens for all routes of my single page app and also to meta tags where there are two sets of the tags I intended to have.

looks like this

I used the default prerender settings like so:

  config.plugins.push(new PrerenderSPAPlugin({
    // Required - The path to the webpack-outputted app to prerender.
    staticDir: path.join(__dirname, 'dist'),
    // Required - Routes to render.
    routes: ['/', '/about'].concat(contracts.map(each => `/${each.abi}/${each.contract}`)),
  }))

回答1:


was the same, but with Angular

in my case helped replacing function this.meta.addTag() with this.meta.updateTag()

so think it's not hosting issue)



来源:https://stackoverflow.com/questions/53407589/using-vue-head-with-prerender-spa-plugin-is-causing-title-and-meta-tags-to-be-di

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!