Salta ai contenuti

Expected image options, not an ESM-imported image.

Questi contenuti non sono ancora disponibili nella tua lingua.

ExpectedNotESMImage: An ESM-imported image cannot be passed directly to getImage(). Instead, pass an object with the image in the src property.

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:

Contribuisci

A cosa stai pensando?

Crea una Issue su GitHub

Il modo più rapido per segnalare un problema al nostro team.

Comunità
京ICP备15031610号-99