Expected image options, not an ESM-imported image.
이 내용은 아직 번역본이 없습니다.
ExpectedNotESMImage: An ESM-imported image cannot be passed directly to
getImage()
. Instead, pass an object with the image in thesrc
property.
What went wrong?
Section titled What went wrong?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