You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
generateMetadata is not called anymore if it is in page.tsx, it's called only from layout.tsx when upgrading from v14.2.7 to v14.2.8, making all the pages dynamic titles to disappear.
#70717
Closed
RazvanRauta opened this issue
Oct 2, 2024
· 3 comments
· Fixed by #70732
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.
The text was updated successfully, but these errors were encountered:
What's interesting is that you split up the generateMetadata and the Client Component, so Next.js was not able detect that generateMetadata was in a Client Component.
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
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:
The title from
layout.tsx
is shown, not the one frompage.tsx
. If thegenerateMetadata
function is deleted fromlayout.tsx
, no title is shown in the browser tab.Downgrade nextjs to
v14.2.7
and the titles frompage.tsx
are back without any changes.Current vs. Expected behavior
generateMetadata
should work like before v14.2.8Provide environment information
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
.The text was updated successfully, but these errors were encountered: