https://nextjs.org/docs/app/building-your-application/optimizing/metadata
Unanswered
Masai Lion posted this in #help-forum
Masai LionOP
Followed this for next 13 but no meta data appears. I am not using typescript, does it matter? How do i debug this?
17 Replies
@Masai Lion Followed this for next 13 but no meta data appears. I am not using typescript, does it matter? How do i debug this?
Are you using “use client†in the page/layout where the metadata is defined?
Masai LionOP
No, its page.jsx it says server side
Give me a minimal reproduction repository then
Masai LionOP
Pages.jsx file
import { Metadata } from "next";
//The metadata object and generateMetadata function exports are only supported in Server Components.
export const metadata = {
title:
"journeai.com: A personalized and detailed trip itinerary for any travel idea or place in the world in seconds using ai",
icon: "/favicon.ico",
description:
"Hyperpersonalized travel itinaries with 2d and 3d maps in seconds. Get street view images, visa and currency information the weather at destination, saving trips and support for 9 languages.",
};
export default function Home() {
return (
<AuthContext>
<main
style={{
background: "white",
width: "100%",
height: "100%",
margin: "0px",
padding: "0",
}}
</main>
</AuthContext>
);
}
//The metadata object and generateMetadata function exports are only supported in Server Components.
export const metadata = {
title:
"journeai.com: A personalized and detailed trip itinerary for any travel idea or place in the world in seconds using ai",
icon: "/favicon.ico",
description:
"Hyperpersonalized travel itinaries with 2d and 3d maps in seconds. Get street view images, visa and currency information the weather at destination, saving trips and support for 9 languages.",
};
export default function Home() {
return (
<AuthContext>
<main
style={{
background: "white",
width: "100%",
height: "100%",
margin: "0px",
padding: "0",
}}
<App />
</main>
</AuthContext>
);
}
i mean a minimal reproduction repository – a minimal nextjs app that i can clone and debug
Masai LionOP
Do you have a working example any chance? Cannot do on my phone but if nothong is wrong with the code
Any working nextjs app router applications you can find is a working example because their metadata works fine
Masai LionOP
I pretty much used this fro upgrading tonextjs13 https://github.com/3a1b2c3/chat_lc
which works just fine, maybe helps me debug
Masai LionOP
Solved now for meta tags, i dont see icon
Minor problem but if my favicon.ico is in public should this work?
export const metadata= {
icon: "/favicon.ico",
};
export const metadata= {
icon: "/favicon.ico",
};
but if you really, really want to use metadata object export, then put it in
public/favicon.ico and use { icons: { icon: '/favicon.ico' } } (just don't, just put it in app/favicon.ico)Masai LionOP
Whatever works in next.js 13
it was fine before my upgrade
Masai LionOP
thanks again