I have a Next.js 14.2
webapp with App router and try to include an open-graph image by exporting static metadata in the rootlayout file:
export const metadata = { metadataBase: new URL(`${process.env.NEXT_PUBLIC_BASE_URL}`), title: { default: "my-title, template: '%s | my-title' }, description: "Some description", twitter: { card: "summary_large_image" }};
The opengraph-image is located in the app/
route under the exact name: opengraph-image.png
.
It works in development mode on localhost:3000
but when I deploy the app to heroku the image is not showing up.The og-image
tag is included in the header:
but when I try to navigate to it heroku says:
There's nothing here, yet.Build something amazing
Any ideas how to fix it?