Next.js Discord

Discord Forum

opengraph-image wrong path

Unanswered
Asian black bear posted this in #help-forum
Open in Discord
Asian black bearOP
I have a segment as follows tool/roast and there is an opengraph-image.png located in that segment.

In development, everything works fine but in the containerized form the path becomes http://localhost:3000/tool/roast/tool/roast/opengraph-image.png?1a9750650a319459

As you can see tool/roast is duplicated twice. So naturally it does not work.

What am I doing wrong?

6 Replies

I don't really know what the problem is, but I think it's related to your browser. Another solution is to generate the OG image using [Dynamic Metadata](https://nextjs.org/docs/app/building-your-application/optimizing/metadata#dynamic-metadata)
@Ray have you tried it with `next build` && `next start`? if it works, maybe some setting are wrong on the container
Asian black bearOP
Thats what I am doing in the container pnpm install && pnpm start
Asian black bearOP
Alright