Skip to content

Failed parsing 'srcset' attribute value since it has an unknown descriptor #1052

Closed
@alizhdanov

Description

@alizhdanov

Version

13.5.0

Reproduction link

https://github.com/makedonec88/vue-loader-srcset-bug

Steps to reproduce

If you haven't specified srcset descriptor vue'll render it with undefined and in my case, break picture tag behaviour

<picture>
  <source srcset="http://www.gstatic.com/webp/gallery/1.webp">
  <source srcset="http://www.gstatic.com/webp/gallery/1.jpg">
  <img src="http://www.gstatic.com/webp/gallery/1.jpg" alt="test image">
</picture>

What is expected?

The same <picture> tag

What is actually happening?

<picture>
  <source srcset="http://www.gstatic.com/webp/gallery/1.webp undefined">
  <source srcset="http://www.gstatic.com/webp/gallery/1.jpg undefined">
  <img src="http://www.gstatic.com/webp/gallery/1.jpg" alt="test image">
</picture>

Specs say

srcset value must consist of one or more image candidate strings ...
... An image candidate string consists of ...
...Zero or one of the following: A width descriptor or A pixel density descriptor

Si I'm expecting that I don't have to specify descriptor in each srcset

P.S. I believe related to this issue #1005

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions