Skip to content

Meta tags are moving to <body> tag instead of <head> tag #82485

@dmythro

Description

@dmythro

Link to the code that reproduces this issue

https://github.com/dmythro/next-meta-bug

To Reproduce

  1. bun i
  2. bun run build && bun start
  3. Refresh the page until you will see meta tags in <body>

Current vs. Expected behavior

Sometimes I get meta tags inside <body> on production builds, which breaks the SEO etc. Just keep refreshing the page until you see it.
On my main project it happens almost always, I'll see if I can improve this example for reproduction later (I've been adding patterns from my project until started seeing meta tags in <body> instead of the <head>).

Image

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T8132
  Available memory (MB): 24576
  Available CPU cores: 10
Binaries:
  Node: 22.18.0
  npm: 10.9.3
  Yarn: 1.22.22
  pnpm: 10.8.0
Relevant Packages:
  next: 15.4.6 // Latest available version is detected (15.4.6).
  eslint-config-next: N/A
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.9.2
Next.js Config:
  output: standalone

Which area(s) are affected? (Select all that apply)

Metadata

Which stage(s) are affected? (Select all that apply)

Vercel (Deployed)

Additional context

At the end I've seen this reproduced on my project no matter the runtime: both node and bun reproduce the issue.
I deployed same code via docker and to Vercel (for testing). Added example Dockerfile to repo.

I have also seen this issue, might be relevant:
https://stackoverflow.com/questions/79585863/meta-tags-are-moving-to-body-tag-instead-of-head-tag

Metadata

Metadata

Assignees

No one assigned

    Labels

    MetadataRelated to Next.js' Metadata API.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions