App Router Metadata from Overriding Page Router Metadata
Unanswered
Siamese Crocodile posted this in #help-forum
Siamese CrocodileOP
Hi everyone!
We're in the process of gradually moving to the app router in our Next.js project. In app/layout.tsx, we export our metadata, and for our pages router, we're still utilizing the <Head> component for metadata. However, the app router's metadata also appears on pages managed by the page router (resulting in duplicate metadata) and is being prioritized :(.
Does anyone know on how to make sure the metadata from the page router takes is use, or a way to prevent the app router's metadata from duplicating on page router managed pages?
Thanks in advance!
We're in the process of gradually moving to the app router in our Next.js project. In app/layout.tsx, we export our metadata, and for our pages router, we're still utilizing the <Head> component for metadata. However, the app router's metadata also appears on pages managed by the page router (resulting in duplicate metadata) and is being prioritized :(.
Does anyone know on how to make sure the metadata from the page router takes is use, or a way to prevent the app router's metadata from duplicating on page router managed pages?
Thanks in advance!
5 Replies
Original message was deleted
What are conditional metadata, dynamic metadata, metadata injection? Please do NOT post AI generated answers especially when you are not certain they are correct
@Siamese Crocodile Hi everyone!
We're in the process of gradually moving to the app router in our Next.js project. In app/layout.tsx, we export our metadata, and for our pages router, we're still utilizing the <Head> component for metadata. However, the app router's metadata also appears on pages managed by the page router (resulting in duplicate metadata) and is being prioritized :(.
Does anyone know on how to make sure the metadata from the page router takes is use, or a way to prevent the app router's metadata from duplicating on page router managed pages?
Thanks in advance!
That does sound like a bug, whatever happening in the app router should not influence the pages router at all. Could you make a minimal reproduction repository?
@joulev That does sound like a bug, whatever happening in the app router should not influence the pages router at all. Could you make a minimal reproduction repository?
Siamese CrocodileOP
Will do. We are on version 13.8 not sure if its related
@Siamese Crocodile Will do. We are on version 13.8 not sure if its related
Next doesn’t have v13.8. But since the app router was unstable in v13, highly recommended to upgrade to v14 where the app router is stable and is officially supported
Siamese CrocodileOP
Ment 13.4.8. We Will update first if that wont do the trick we will make a reproduction thanks!