ExpectedNotESMImage: An ESM-imported image cannot be passed directly to
getImage(). Instead, pass an object with the image in thesrcproperty.
An ESM-imported image cannot be passed directly to getImage(). Instead, pass an object with the image in the src property.
import { getImage } from "astro:assets";
import myImage from "../assets/my_image.png";
const optimizedImage = await getImage( myImage );
const optimizedImage = await getImage({ src: myImage });
See Also:
Error Reference
© 2021 Fred K. Schott
Licensed under the MIT License.
https://docs.astro.build/en/reference/errors/expected-not-esmimage/