About This HTML Issue
A <link> element has an imagesizes attribute, but at least one URL in its imagesrcset has no width descriptor such as 800w.
imagesrcset and imagesizes are the preload versions of the srcset and sizes attributes of <img>. On a <link rel="preload" as="image">, they let the browser start downloading the same file that the <img> will pick later.
imagesizes says how wide the image will be in the layout, and the browser compares that width with the w descriptor of each candidate to choose one. A URL with no descriptor gives it no width to compare, so when imagesizes is present, every candidate needs one. The message names "sizes" because the validator reuses its <img> wording.
This can come from a theme or plugin that preloads the main image of a page by copying the image's srcset into imagesrcset. When the image exists in only one size, that copy is a bare URL, but the plugin still prints imagesizes.
To fix it, add the width of each image file in pixels after its URL, as in hero.jpg 800w. If you preload a single file, you can also remove imagesrcset and imagesizes and put the URL in href instead. Density descriptors such as 2x won't work here either: next to imagesizes, the validator reports them as a different error.
Invalid example
<link
rel="preload"
as="image"
imagesrcset="hero.jpg"
imagesizes="(max-width: 800px) 100vw, 800px">
Valid example
<link
rel="preload"
as="image"
imagesrcset="hero.jpg 800w"
imagesizes="(max-width: 800px) 100vw, 800px">
Find issues like this automatically
Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.