Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/practical-silence-f2sz85?workspaceId=a8fd7a94-21d9-4864-97fb-6ae7e1b980d5
To Reproduce
-
Upgrade nextjs to v14.2.8
-
Create some pages with the following folder structure:
| [ lang ]
│ layout.tsx <------- generateMetadata () => return { title: "Layout" };
│
└───( group )
| group-layout.tsx
|
│ └───page 1
│ │ page.tsx <------- generateMetadata () => return { title: "Page 1" };
│ │ page-content.txt
|
│ └───page 2
│ │ page.tsx <------- generateMetadata () => return { title: "Page 2" };
│ │ page-content.txt
-
The title from layout.tsx is shown, not the one from page.tsx. If the generateMetadata function is deleted from layout.tsx, no title is shown in the browser tab.
-
Downgrade nextjs to v14.2.7 and the titles from page.tsx are back without any changes.
Current vs. Expected behavior
generateMetadata should work like before v14.2.8
Provide environment information
Operating System:
Platform: linux
Arch: arm64
Version: #1 SMP Wed Jul 17 10:51:09 UTC 2024
Available memory (MB): 7839
Available CPU cores: 11
Binaries:
Node: 20.17.0
npm: 10.8.2
Yarn: 1.22.22
pnpm: 9.1.0
Relevant Packages:
next: 14.2.8 // There is a newer version (14.2.14) available, upgrade recommended!
eslint-config-next: N/A
react: 18.3.1
react-dom: 18.3.1
typescript: 5.5.4
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Metadata
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local)
Additional context
The bug was introduced in v14.2.8.