Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
duplicate meta tags in head | GoodFirstPicks

duplicate meta tags in head

vercel/next.js 32 comments 1mo ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeNext.jsTypeScriptReact

Why this is a good first issue

Issue involves third-party script injection affecting head tag management.

AI Summary

The issue involves duplicate meta tags in the head due to Google Tag Manager injecting scripts above `next-head-count`, disrupting the order during hydration. The problem is reproducible and confirmed by multiple users, but the solution requires understanding how Next.js manages head tags and interacts with third-party scripts.

Issue Description

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64 Binaries: Node: 14.20.0 npm: 6.14.17 Yarn: 1.22.18 pnpm: N/A Relevant packages: next: 12.2.2 eslint-config-next: 12.0.10 react: 17.0.2 react-dom: 17.0.2

What browser are you using? (if relevant)

chrome, safari

How are you deploying your application? (if relevant)

No response

Describe the Bug

some meta tags in the head are duplicated.

this can be even seen on the official nextjs page (viewport meta tag):

Bildschirmfoto 2022-07-21 um 18 25 32

interestingly, in chrome this happens on my computer only when in a guest / icognito window.

those duplication are not present on the SSR source, so its a hydration problem

Expected Behavior

no duplicate tags

Link to reproduction

https://nextjs.org/

To Reproduce

open https://nextjs.org/

use inspector, look at the head

GitHub Labels

bug

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!

Risk Flags

  • third-party integration (GTM)
  • hydration issue
Loading labels...

Details

Points10 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno