Next.js Discord

Discord Forum

Image component generates multiple time the same image

Unanswered
Eurasian Blackbird posted this in #help-forum
Open in Discord
Eurasian BlackbirdOP
Hello, I have this code :
<div style={{ position: "relative", width: "100%", height: "100%" }}>
            <Image
              src={mainImageUrl} // remote url
              alt={name}
              fill
              style={{ objectFit: "contain" }}
              sizes="(max-width: 767px) 90%, 17%"
            />
          </div>

And I realised that instead of generating the same image with differents sizes, it only generated the same image multiple times at the same size. Does anyone knows why. Thank you

0 Replies