What does "Failed parsing 'srcset' attribute value since its 'w' descriptor is invalid." mean? What does "Failed parsing 'srcset' attribute value since its 'w' descriptor is invalid." mean? wordpress wordpress

What does "Failed parsing 'srcset' attribute value since its 'w' descriptor is invalid." mean?


I had a similar error:

failed parsing srcset attribute value since it has an unknown descriptor

and the problem was caused by a space in the image path URL.


tldr; Your html is invalid and you are missing the actual width number.

This is a valid img tag with srcset:

<img src="phone.jpg" srcset="phone-small.jpg 256w, phone-big.jpg 512w" />

It says that if your browser understands srcset it should use the small image when the width is approx 256 px wide, and the bigger image when it is 512 px wide.

In your image tag you have nothing in front of the w:

srcset="http://...resize=425%2C200 w, ...

Notice there is nothing specifying the width? That's the problem. Change it to something like 600w to use the pic for screen widths of 600 pixels, etc.


In my case I simply forgot to put a comma between the images