astro-bun icon indicating copy to clipboard operation
astro-bun copied to clipboard

Cannot serve `.webp` image in `mdx`

Open namdien177 opened this issue 6 months ago • 2 comments

I'm using hybrid mode with mdx to render the blog content.

With @astrojs/node, the production build serves the image with .webp normally. But with astro-bun, it is always 404 not found for images in webp format.

I checked with the png version of the same image, it serves normally. I also ensured the webp version of the image was not broken.

[//]: # Sample mdx file in the content folder
import { Image } from 'astro:assets';

import ImageCAT6Cable from './cat6-cable.png';

some markdown content here

<figure>
  <Image
    loading={'lazy'}
    src={ImageCAT6Cable}
    alt="cat6 cable" />
  <figcaption>some caption</figcaption>
</figure>

some markdown content here

The image resolved to the correct path (/_astro/cat6-cable<random>.webp) but returns 404. If I change the image path directly to the PNG version (/_astro/cat6-cable<random>.png), it will work just fine.

namdien177 avatar Aug 17 '24 16:08 namdien177