Metadata isn't updating for my other pages. Just reading my RootLayout Metadata`=
Answered
Highlander posted this in #help-forum
HighlanderOP
I am implementing my metadata on server side pages not client side pages and when I try to update the metadata for my settings page, it just reads the metadata from my Root Layout.
Here is the part of the code of the metadata:
Root Layout
Here is the part of the code of the metadata:
import { Metadata } from "next";
const metadata: Metadata = {
title: "Settings",
description: "Manage your account settings!",
alternates: {
canonical: "https://www.voicefusion.io/settings",
},
};Root Layout
import { Metadata } from "next"
export const metadata: Metadata = {
title: 'Voice Fusion',
description: 'AI Generated voices for your videos',
alternates: {
canonical: 'https://www.voicefusion.io',
}
}Answered by riský
anyway i just realised you didn't export metadata in first codeblock
11 Replies
@Highlander I am implementing my metadata on server side pages not client side pages and when I try to update the metadata for my settings page, it just reads the metadata from my Root Layout.
Here is the part of the code of the metadata: import { Metadata } from "next";
const metadata: Metadata = {
title: "Settings",
description: "Manage your account settings!",
alternates: {
canonical: "https://www.voicefusion.io/settings",
},
};
Root Layout
import { Metadata } from "next"
export const metadata: Metadata = {
title: 'Voice Fusion',
description: 'AI Generated voices for your videos',
alternates: {
canonical: 'https://www.voicefusion.io',
}
}
you can only set metadata in server components, have a look at this page to see alternatives for client https://nextjs-faq.com/metadata-client-components
HighlanderOP
@riský I am using server pages.
ohh sorry i missread when you meantioned client 😓
anyway i just realised you didn't export metadata in first codeblock
Answer
HighlanderOP
no worries and lol I bet thats the problem
right when you said that I was like I am so dumb
thank you
some things both of us forget about ;/
but glad to see your question solved 🙂
HighlanderOP
yea stupid mistake, always good to have another set of fresh eyes
tbf i like helping even these simple mistakes because it is nice to see people happy 🙂