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 respected for og images #66957

Open
wereHamster opened this issue Jun 17, 2024 · 0 comments
Open

metadataBase not respected for og images #66957

wereHamster opened this issue Jun 17, 2024 · 0 comments
Labels
bug Issue was opened via the bug report template. Metadata Related to Next.js' Metadata API.

Comments

@wereHamster
Copy link
Contributor

Link to the code that reproduces this issue

https://github.com/wereHamster/nextjs-metadata-base-og-image-bug

To Reproduce

Literally copied the code from the docs:

export const metadata = {
  metadataBase: new URL('https://acme.com'),
  alternates: {
    canonical: '/',
    languages: {
      'en-US': '/en-US',
      'de-DE': '/de-DE',
    },
  },
  openGraph: {
    images: '/og-image.png',
  },
}

Current vs. Expected behavior

Expected behavior is that the og image url is prefixed with metadata base, but it's not.

In the docs:

<meta property="og:image" content="https://acme.com/og-image.png" />

actual:

image

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 22.2.0: Fri Nov 11 02:04:44 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T8103
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 20.12.2
  npm: 10.5.0
  Yarn: N/A
  pnpm: 8.15.5
Relevant Packages:
  next: 14.2.4 // Latest available version is detected (14.2.4).
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: N/A
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)

Additional context

No response

@wereHamster wereHamster added the bug Issue was opened via the bug report template. label Jun 17, 2024
@github-actions github-actions bot added the Metadata Related to Next.js' Metadata API. label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Metadata Related to Next.js' Metadata API.
Projects
None yet
Development

No branches or pull requests

1 participant