Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metadataBase not set, only works in layout.tsx #387

Open
trevorpfiz opened this issue Jan 5, 2025 · 1 comment
Open

metadataBase not set, only works in layout.tsx #387

trevorpfiz opened this issue Jan 5, 2025 · 1 comment
Labels
blocked We can't work on this just yet. bug Something isn't working

Comments

@trevorpfiz
Copy link
Contributor

trevorpfiz commented Jan 5, 2025

Describe the bug
Setting metadataBase in createMetadata is not working in page.tsx. To fix this, I am calling createMetadata once in the root layout, and then in the page.tsx I just change the title and description with export const metadata: Metadata = {, not by using createMetadata again.` What is best practice here?

next-forge version
I am using version 3

To Reproduce
Steps to reproduce the behavior:

  1. Go to (home)/page.tsx
  2. Set metadataBase
  3. Check in browser dev tools
  4. See that opengraph-image is not set

Expected behavior
I expect for the opengraph-image to be set. Right now

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
@trevorpfiz trevorpfiz added the bug Something isn't working label Jan 5, 2025
@haydenbleasel
Copy link
Owner

@trevorpfiz Great find! This is actually an open Next.js bug: vercel/next.js#48106

@haydenbleasel haydenbleasel added the blocked We can't work on this just yet. label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked We can't work on this just yet. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants