Gatsby: Native loading="lazy" lacks dimensions inside gatsby-image.

Created on 9 Sep 2019  路  25Comments  路  Source: gatsbyjs/gatsby

Description

I am using the fluid queries within gatsby-image. When using the default loading="lazy", I get the following warning inside the console:

Screenshot 2019-09-09 at 15 44 21

[Intervention] An <img> element was lazyloaded with loading=lazy, but had no dimensions specified. Specifying dimensions improves performance. See https://crbug.com/954323

I tried to search for this issue, but only found 2 unanswered questions on spectrum. I am using gatsby 2.15.11 and gatsby-image 2.2.17. As far as I can see the native lazy-loading has been introduced in gatsby-image 2.1.0.

It also appears on https://using-gatsby-image.gatsbyjs.org/

not stale imagemedia upstream

Most helpful comment

I've created an upstream issue on chromium https://bugs.chromium.org/p/chromium/issues/detail?id=1002455. Seems like chrome doens't detect fluid containers and mark images without dimensions as faulty. You shouldn't worry about it.

All 25 comments

I think the problem here is that fluid images by their nature can't have their size set in the HTML, because they're supposed to resize to fit their container. I'm not sure if there's a way around this (or if it's actually a problem).

I've created an upstream issue on chromium https://bugs.chromium.org/p/chromium/issues/detail?id=1002455. Seems like chrome doens't detect fluid containers and mark images without dimensions as faulty. You shouldn't worry about it.

@ascorbic
It is a warning, so nothing breaks the site. I just like to keep my console clean, so I thought to make people aware of it.

@wardpeet Thanks for creating an issue on chromium, I actually didn't think of that it could be an issue in the browser. It makes sense though.

Hiya!

This issue has gone quiet. Spooky quiet. 馃懟

We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 馃挭馃挏

Hey again!

It鈥檚 been 30 days since anything happened on this issue, so our friendly neighborhood robot (that鈥檚 me!) is going to close it.

Please keep in mind that I鈥檓 only a robot, so if I鈥檝e closed this issue in error, I鈥檓 HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the Gatsby community!

馃憖

This issue is still relevant and should be reopened I think

Still an issue. Even with it being fluid we should be able to pass in attributes

This causes chrome not to lazy load at all, and the lighthouse/audit rankings are down the drain because of this.

I'd also like to see this being addressed. Adding attributes to images, even when fluid, is slowly becoming a new best practice.

We can鈥檛 use fluid images for now. I鈥檓 using only fixed images without the possibility to set attributes on fluid images...

I am facing this issue as well, would be great if this could be adressed any time soon.

Still facing this issue

Still a thing

Still an issue 馃樋

Still an issue here too (blazy in css backgrounds).

Looks like the removal of this console warning was just merged into Chromium: https://chromium-review.googlesource.com/c/chromium/src/+/2159142. Not sure when it will appear in Chrome, perhaps after the next major release (mid-May I believe)?

As of 1st June using the latest release build of Chrome (Version 83.0.4103.61) this is still an issue.

Still no changes about this issue.

checking back, still seeing this issue.

Still an issue

Still an issue

Chrome: version 83.0.4103.116 (Official Build) (64-bit)

Still an Issue as of today!

I've just updated Chrome to Version 84.0.4147.89 (Official Build) (64 bit) and I'm not getting the console warning anymore, I suppose that the removal of the warning message was merged into Chrome stable 馃帀

Closing as this was a Chrome issue that has apparently been resolved as per @E-PL!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

3CordGuy picture 3CordGuy  路  3Comments

andykais picture andykais  路  3Comments

totsteps picture totsteps  路  3Comments

magicly picture magicly  路  3Comments

mikestopcontinues picture mikestopcontinues  路  3Comments