Replies: 1 comment 1 reply
-
I think the OG image issue might be happening because this expression always returns a (truthy) string, so the fallback never runs. const logo = websiteData?.setting?.logo;
const openGraphImage = logo
? new URL(logo, BASE_URL).toString()
: `${WEB_URL}/assets/images/apoorva_logo.png`; Try checking the logo first like this, so BASE_URL is only added when it actually exists. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Hi everyone 👋
I’m facing an issue with Open Graph images on my Next.js 15 project deployed on Vercel.
On my blog page, I set metadata using generateMetadata and the output in the is correct. Example:
When I view page source, all meta tags are present and correct.
But when I share the blog URL on WhatsApp or Facebook, title and description show, but the image does not load.
✅ Things I’ve checked:
The image URL is correct and opens in browser.
The og:image URL is absolute HTTPS.
Metadata is rendered server-side via generateMetadata.
No errors in Next.js logs.
❌ Problem persists only with the image not appearing on social previews.
📝 URL: https://apoorvaproducts-j8on.vercel.app/blog
I suspect this might be related to how the image is hosted (different domain from the Vercel app), or possibly scraper access to the image server.
Has anyone faced a similar issue with OG images on a different domain or with WhatsApp previews? Any reliable way to fix this without moving the image hosting?
Thanks 🙏
page.js
page.js
Additional information
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions