withastro/astro

No discord image embeds for blog posts

Closed this issue · 3 comments

Astro Info

Astro                    v5.0.5
Node                     v22.6.0
System                   macOS (arm64)
Package Manager          bun
Output                   static
Adapter                  none
Integrations             @astrojs/tailwind
                         @astrojs/sitemap
                         @astrojs/mdx
                         @astrojs/react
                         astro-icon

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

If I paste my website "https://www.formalsnake.dev/" in discord it embeds correctly
Screenshot 2024-12-19 at 10 10 20
But when trying to embed my blog posts, I do not get an image
Screenshot 2024-12-19 at 10 11 02
But the og:image and the twitter:image tags correctly link to the image.
A direct link to the og:image doesn't embed either
Screenshot 2024-12-19 at 10 29 45
But the creator of the template has a modified version for it for their website, and their image does embed correctly
Screenshot 2024-12-19 at 10 30 10
Screenshot 2024-12-19 at 10 30 49

Why is this happening? I tried to disable cloudflare image scraping protection to no avail

I am using this template: https://astro.build/themes/details/astro-erudite/

What's the expected result?

A correct embed

Link to Minimal Reproducible Example

https://stackblitz.com/github/jktrn/astro-erudite?file=README.md

Participation

  • I am willing to submit a pull request for this issue.

Btw, formalsnake.dev uses this template but upgraded myself to astro 5.0, with the same issue

I think this is a Discord glitch for that particular post. Did you try it before adding the image? Discord will cache it, so may not pick up changes. The code and image look fine, and other blog posts work. I tested the original link and it works in Bluesky and Twitter too.

Thank you! It's indeed a discord issue and a support ticket has been submitted