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.

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

See original GitHub issue

Hi, Firstly, thanks for the amazing work you do, hope they decide to make everyone’s life better by making vue-head a standard part of vue soon.

I am not sure this is an issue with vue-head but please forgive me if I am wasting your time.

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

the live site shows : <title>about | anonplayer about | anonplayer</title> but my component has

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

and this happens for every page of my single page app

and this is also happening to meta tags i set using vue-head where there are two sets of the tags i intended to have.

looks like this

I have the default prerender settings :

      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}`)),
      }))

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
bigseecommented, Mar 30, 2019

Maybe that’s what this option is for: https://github.com/ktquez/vue-head#default-custom-title ?

2reactions
d0peCodecommented, Feb 18, 2019

I have following code for title in my index component:

export default {
    head: {
        title: function () {
            return {
                inner: this.$options.filters.translate('yacht charter'),
                separator: ' ',
                id: 'indexTitle'
            }
        },

I’m also using prerender-spa-plugin. Title at first is once (when I use show code ctrl+U) but when javascript loads and execute, it double title.

This happen only to prerendered app.

I’m doing something wrong?


Edit 18.02.2019

I think I fixed it with changing 7th line in vue-head.js in node_modules directory from:

complement: window.document.title,

to

complement: '',
Read more comments on GitHub >

github_iconTop Results From Across the Web

using vue-head with prerender-spa-plugin is causing title and ...
using vue-head with prerender-spa-plugin is causing title and meta tags to be displayed twice on netlify · vue.js · single-page-application · vue- ...
Read more >
using vue-head with prerender-spa-plugin is causing title and ...
Coding example for the question using vue-head with prerender-spa-plugin is causing title and meta tags to be displayed twice on netlify-Vue.js.
Read more >
Fixing the Error "Duplicate Meta Titles" in SEO with Siteimprove
The rel="canonical" tag should be put into the duplicate page and should point to the original page. If the original from our examples...
Read more >
How to Fix Duplicate Meta Descriptions and Titles in WordPress
#1 Method: Meta Tags Analyzer. Backstory. I wrote this article back in the days when Google Webmaster Tools (GWT) used to show duplicate...
Read more >
How do I fix duplicate meta tags? - Yoast
Google Search Console (former Google Webmaster Tools) reports you to have duplicate meta titles or duplicate meta descriptions. Each URL should have unique ......
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