Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

titleTemplate is not working properly and repeats itself multiple times #6428

Closed
matobeno1 opened this issue Sep 12, 2019 · 3 comments · Fixed by #6429
Closed

titleTemplate is not working properly and repeats itself multiple times #6428

matobeno1 opened this issue Sep 12, 2019 · 3 comments · Fixed by #6429

Comments

@matobeno1
Copy link

Version

v2.9.2

Reproduction link

https://gitlab.com/matobeno1/nuxt-title-issue/

Steps to reproduce

  • start the dev server
  • open any link in the new tab and watch the site title
  • go to the opened tab and try reloading (alternatively hard reloading)

What is expected ?

The site title for each route should be the way it is defined in the nuxt.config.js

head: {
    titleTemplate: '%s - MyApp',
    title: 'TheTitle',
    // ...
}

So the site title should be e.g. TheTitle - MyApp

What is actually happening?

After several reloads the "- MyApp" is appended so the final look
of the site title is e.g.

TheTitle - MyApp - MyApp

or even

TheTitle - MyApp - MyApp - MyApp - MyApp - MyApp - MyApp (multiple times repeated based on how many times I reload)

Additional comments?

I don't really know how exactly to reproduce this, there is a GIF image in the Reproduction link repo, sometimes you might
need to reload several times, try opening several routes and reloading / hard reloading the site, clicking on route-links and reloading. After a while you should see that the site title is repeating itself. It happens in the production build and development build as well.
Tried to reproduce on Firefox Dev, Edge, Chrome, happens on all of those.
Any help appreciated

This bug report is available on Nuxt community (#c9768)
@pimlie pimlie transferred this issue from nuxt/nuxt Sep 15, 2019
@pimlie
Copy link

pimlie commented Sep 15, 2019

Have transferred this to the vue-meta repo as this seems mostly a vue-meta issue.

This is probably caused by a combination of:
nuxt/vue-meta#429 and
https://vue-meta.nuxtjs.org/api/#generate-since-v2-2 which is used by Nuxt.js in SPA mode

Will have to look into this further

@pimlie pimlie transferred this issue from nuxt/vue-meta Sep 17, 2019
@pimlie
Copy link

pimlie commented Sep 17, 2019

Transferred the issue back to nuxt.js, cause I realized its a Nuxt issue.

@pi0
Copy link
Member

pi0 commented Sep 17, 2019

Fix willl be available in next release (and also latest nuxt-edge)

@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants