Might be worth mentioning that I am using React and Webpack.
Example of this:
<img src="https://increasify.com.au/wp-content/uploads/2016/08/default-image.png" srcset="http://www.rangerwoodperiyar.com/images/joomlart/demo/default.jpg x2"
My goal is to take advantage of the srcset attribute to detect if the screen density is x2 to let the browser determine the use of the larger image.
Image shows fine, but it’s not using the larger image described in the srcset attribute for retina or higher density screens.
It is also showing the following Errors in the console:
Failed parsing 'srcset' attribute value since it has an unknown descriptor.coming fromvendor.bundle.jsDropped srcset candidate "<URL>"Dropped srcset candidate "http://www.rangerwoodperiyar.com/images/joomlart/demo/default.jpg"
I’m using the latest version of Chrome currently Version 70.0.3538.110
Advertisement
Answer
I found the issue, I had put x2 when it should be 2x silly mistake.