Next.js Discord

Discord Forum

"Image has either width or height modified" but both properties are set

Unanswered
Bigheaded ant posted this in #help-forum
Open in Discord
Bigheaded antOP
Image with src "/assets/images/killer.png" has either width or height modified, but not the other. If you use CSS to change the size of your image, also include the styles 'width: "auto"' or 'height: "auto"' to maintain the aspect ratio.
"use client"
Page @ page.tsx:37
// page.tsx:36
<a href='/perks/killer' className='text-red-400'>
  <Image
    src='/assets/images/killer.png'
    alt='Killer Icon'
    width={200}
    height={200}
  />
  Killer Perks
</a>

Its only a warning but it still stays here despite refreshing the site. I dont know why its even complaining if Im providing both dimensions.

0 Replies