Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

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

Closed
hjujah opened this issue Nov 30, 2017 · 3 comments
Closed

Comments

@hjujah
Copy link

hjujah commented Nov 30, 2017

Hello, I am really struggling to get this to work.

Here is how I import the script:
import picturefill from 'picturefill'

Here is my html:

<picture>
        <!--[if IE 9]><video style="display: none;"><![endif]-->
        <source srcset="/static/guy.webp" media="(min-width: 800px)" type="image/webp">
        <source srcset="/static/guy.png" media="(min-width: 800px)">
        <!--[if IE 9]></video><![endif]-->
        <img srcset="/static/guy.png" alt="image desc">
</picture>

And since I am using vue.js in the ,,mounted" (its being executed when the DOM is rendered) method i have the following:

mounted()  {
   picturefill()
},

And here is the full error which I am getting:

Failed parsing 'srcset' attribute value since it has an unknown descriptor.
Dropped srcset candidate "/static/guy.webp"

Any ideas what I am doing wrong?

Thanks!

@hackuun
Copy link

hackuun commented Jan 19, 2018

I got exactly the same issue. Did you solve it?

@paulroub
Copy link

Might this actually be the vue.js bug noted here, and nothing to do with Picturefill?

@aFarkas
Copy link
Collaborator

aFarkas commented Feb 26, 2018

@paulroub
You should be right. Chrome does support srcset natively. So picturefill isn't doing anything here.

You can workaround this by explicitly specifying the default descriptor 1x.

This would look like this:

<img srcset="/static/guy.png 1x" alt="image desc" />

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants