ESM imported images must be passed as⁠-⁠is.

LocalImageUsedWrongly: Image’s and getImage’s src parameter must be an imported image or an URL, it cannot be a filepath. Received IMAGE_FILE_PATH.

When using the default image services, Image’s and getImage’s src parameter must be either an imported image or an URL, it cannot be a filepath.

---
import { Image } from "astro:assets";
import myImage from "../my_image.png";
---
<!-- GOOD: `src` is the full imported image. -->
<Image src={myImage} alt="Cool image" />
<!-- BAD: `src` is an image's `src` path instead of the full image. -->
<Image src={myImage.src} alt="Cool image" />

See Also: