Skip to content

Duplicated <meta> tags on initial page using <svelte:head> #5668

Open
@EricRovell

Description

@EricRovell

Using component to compose head contents from an object as Head.svelte:

<svelte:head>
  {#if title}
    <title>{title}</title>
  {/if}
  {#if meta}
    {#each Object.entries(meta) as [ name, content ]}
      <meta {name} {content} />
    {/each}
  {/if}
</svelte:head>

By including this component on any page as:

<Head {props} />

The initial page loaded by the user has duplicated meta tags.
Interesting thing is, by navigating to other pages where such component is present, the second batch of duplicated tags are updated as expected. Title tag is not duplicated, but all meta tags has duplicate of initial page's load and persists forever.

I am using sapper, but I think it is the Svelte related issue.

Versions I use:

  • "sapper": "^0.28.10",
  • "svelte": "^3.29.4".

Same thing as #4533, but <title> tag works fine.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions