Skip to content
This repository has been archived by the owner on Dec 5, 2021. It is now read-only.

Duplicated canonical URL tags are produced #87

Open
ceilfors opened this issue Nov 19, 2020 · 1 comment
Open

Duplicated canonical URL tags are produced #87

ceilfors opened this issue Nov 19, 2020 · 1 comment
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@ceilfors
Copy link

Describe the bug

Two canonical tags are produced

To Reproduce

  1. Setup Nuxt and Nuxt page. Our guess is this is related to Nuxt full static mode

nuxt.config.js

export default {
  mode: "universal",
  target: "static"

pages/foo.vue

export default {
  head() {
    return this.$seo({
      title: "London",
    });
  }
}
  1. Go to foo page

Expected behavior
No duplicated canonical URL tag should be produced in the DOM.

<html>
  <head>
    <link data-n-head="ssr" rel="canonical" href="https://upmo.com/foo">
...

Actual behavior
Duplicated canonical URL tags are produced in the DOM.

<html>
  <head>
    <link data-n-head="ssr" rel="canonical" href="https://upmo.com/">
    <link data-n-head="ssr" rel="canonical" href="https://upmo.com/foo">
...

Additional context

When we change the following code inside module.js

this.options.head.link = createCanonical(options, '/').concat(this.options.head.link || [])

To become:

this.options.head.link = this.options.head.link || []

It seems to have fixed the issue, but we're not sure what implication it will make.

P.S. Paired with @hsks

@TiagoDanin TiagoDanin added bug Something isn't working help wanted Extra attention is needed labels Nov 19, 2020
@TiagoDanin TiagoDanin self-assigned this Nov 19, 2020
@TiagoDanin TiagoDanin added this to To do in Open Source - Tiago Danin via automation Nov 19, 2020
@TiagoDanin
Copy link
Owner

#109

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
Development

No branches or pull requests

2 participants