Next.js Discord

Discord Forum

opengraph-image.jpg not working for the root page

Unanswered
American Crocodile posted this in #help-forum
Open in Discord
American CrocodileOP
For some reason when I place opengraph-image.jpg inside app folder its not render in the output page. I also have separated (main) folder and i tried to put image here but it doesn`t work either. Other pages works fine with static and generated images, but only root (/) page does not contain og:image tag.

metadataBase is included in root layout

export const metadata: Metadata = {
robots: { index: true, follow: true },
metadataBase: new URL(url),
}

6 Replies

American CrocodileOP
the problem is probably related to fact that opengraph image not working is subdirectory like (main) for some reason. but i dont see any openned issues to get information from...
American black bear
@American Crocodile Try to add this on public folder and make folder "images" and add the file image
American CrocodileOP
@American black bear i doubt that i understand correctly but if i did everything right its still not working
its working fine if i include images: [] into metadata but that seems kinda odd since it should work by just placing image inside directory as mentioned in docs
American black bear
Ohh you use metadad i thought you use img
My bad