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.
무엇이 잘못되었나요?
섹션 제목: 무엇이 잘못되었나요?ESM에서 가져온 이미지는 getImage()
에 직접 전달할 수 없습니다. 대신 src
속성에 이미지가 포함된 객체를 전달하세요.
import { getImage } from "astro:assets";import myImage from "../assets/my_image.png"; const optimizedImage = await getImage( myImage ); const optimizedImage = await getImage({ src: myImage });
더 보기:
Error Reference