Open wereHamster opened 4 months ago
Work around for this is to explicitly set the domain on your images:
export const metadata = {
metadataBase: new URL('https://acme.com'),
alternates: {
canonical: '/',
languages: {
'en-US': '/en-US',
'de-DE': '/de-DE',
},
},
openGraph: {
images: 'https://acme.com/og-image.png',
},
}
+1 encountered the same issue here.
specifying metadataBase
does not prefix og + twitter image url.
this makes the documentation here factually incorrect.
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:
Current vs. Expected behavior
Expected behavior is that the og image url is prefixed with metadata base, but it's not.
In the docs:
actual:
Provide environment information
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