Metadata difference in next.js 15 and next.js 14, is this intended? #79916
Unanswered
monognuisy
asked this question in
Help
Replies: 2 comments
-
Facing same issue in Next.js 15.3.X version. Before it was working Fine. Actually What happens is, all meta tags are shifted to the tag instead of . And for the some reason if you refresh the page again page is served with metadata in head and vice versa. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Please read through this: #79404 (comment) This is part of Streaming Metadata.
It can be turned off through |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Summary
I've encountered that the mechanism of metadata is different between next.js 14 and 15 in non-children case.
If the
layout.tsx
has no children inside the<body>
tag, then the metadata (static, or also dynamic one created withgenerateMetadata
function) is not found in the first HTTP request in next.js 15. However, there are metadata for the same case in next.js 14.Is this intended? If so, can I get some kind of reasons for this?
How to reproduce
{ children }
in layout.tsx (/src/app/layout.tsx
)// layout.tsx export const metadata: Metadata = { title: "Create Next App", description: "Generated by create next app", }; export default function RootLayout({ children, }: Readonly<{ children: React.ReactNode; }>) { return ( <html lang="en"> <body className={`${geistSans.variable} ${geistMono.variable} antialiased`} > - { children } </body> </html> ); }
Detailed description
The first HTTP response of the page can affect the SEO(including open graph...), so if you check the response via cURL or the network tab of browser devtools, etc..., you can find the difference between two versions.
Here's the first HTTP GET response for next.js 15 project. (head tag only)

There is no metadata that I written (title, description).
And here's the same one but for the next.js 14 project.

There are the metadata.
Additional information
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions