Issue involves third-party script injection affecting head tag management.
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.
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
chrome, safari
No response
some meta tags in the head are duplicated.
this can be even seen on the official nextjs page (viewport meta tag):
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
no duplicate tags
open https://nextjs.org/
use inspector, look at the head
Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!