Skip to content

[NEXT-888] MetaData title and description will add to body instead head tag #46738

@roshaninet

Description

@roshaninet

Verify canary release

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

Provide environment information

Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:39:35 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T8103
    Binaries:
      Node: 18.13.0
      npm: 8.19.3
      Yarn: 1.22.19
      pnpm: 7.0.0
    Relevant packages:
      next: 13.2.4-canary.1
      eslint-config-next: 13.2.3
      react: 18.2.0
      react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue

https://stackblitz.com/edit/vercel-next-js-erobcb?file=app%2Fpage.tsx,next.config.js,app%2Flayout.tsx

To Reproduce

default meta data in layout.jsx

export const metadata = {
    title: {
        default: 'خرید و اجاره ویلا در شمال',
        template: '%s | املاک دلاوران',
    },
}

page.js metadata:

export const metadata = {
    description: "گروه مشاورین املاک دلاوران، خریدو فروش ویلا در شمال مازندران",
    alternates: {
        canonical: canonicalLink("")
    }
};

Describe the Bug

meta data export will append tag to body tag instead head tag

Screenshot 2023-03-03 at 6 54 28 PM

Expected Behavior

the meta data must be add to head tag.

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

NEXT-888

Metadata

Metadata

Assignees

No one assigned

    Labels

    MetadataRelated to Next.js' Metadata API.linear: nextConfirmed issue that is tracked by the Next.js team.please add a complete reproductionPlease add a complete reproduction.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions