image icon indicating copy to clipboard operation
image copied to clipboard

Passing a sizes prop breaks format=null for Contentful provider in Nuxt3 RC11

Open ohb-itech opened this issue 3 years ago • 0 comments

Using @nuxt/image-edge with Nuxt3 RC11, when using a provider="contentful" and passing :format="null" the output works as expected:

<!-- input -->
<nuxt-img 
  :src="someContentfulSrc"
  :format="null"
  width="100"
  height="100"
  provider="contentful"
/>

<!-- output -->
<img src="https://...?w=100&h=100" width="100" height="100" />

But when also applying a sizes="..." prop, a format of undefined is added to the string, which breaks the image source:

<!-- input -->
<nuxt-img 
  :src="someContentfulSrc"
  :format="null"
  width="100"
  height="100"
  provider="contentful"
  sizes="sm:100px md:200px"
/>

<!-- output -->
<img src="https://...?w=100&h=100&fm=undefined" width="100" height="100" ... />

The ?fm=undefined param is added to both the image src URL and the srcset URLs.

ohb-itech avatar Sep 30 '22 14:09 ohb-itech