opengraph-image wrong path
Unanswered
Asian black bear posted this in #help-forum
Asian black bearOP
I have a segment as follows
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
What am I doing wrong?
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)
@Asian black bear 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?
Sounds like a nextjs bug, could you open an issue?
@Asian black bear 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?
have you tried it with
if it works, maybe some setting are wrong on the container
next build && next start?if it works, maybe some setting are wrong on the container
@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