Next.js Discord

Discord Forum

OG images not working

Unanswered
harshcut posted this in #help-forum
Open in Discord
I have a dynamic route, for i'm generating an og image (without edge runtime). When looking at the header the og image is present, but it won't appear in the link previews. What am I messing?
Here are the og head tags from the page.

6 Replies

export async function generateMetadata({
  params,
}: {
  params: { episodeId: string }
}): Promise<Metadata> {
  return {
    openGraph: {
      images: [`${process.env.NEXT_PUBLIC_DEPLOYMENT_URL}/api/og?episodeId=${params.episodeId}`],
    },
  }
}
this is how i add them to the metedata
Chinese Chongqing Dog
Could be because the image url is http instead of https on your Server, or is this screenshot from your development server?
the server is on http
Chinese Chongqing Dog
Hmm I've never used http urls in my og:image so that could be the problem, maybe it gets blocked because of security reasons
i could'nt find anything online that said og:image do not work on http