Image no explicit width/height on SVG with dimensions
See original GitHub issueProvide the steps to reproduce
- Run LH on https://quiamo-client.vercel.app/
See this https://www.webpagetest.org/result/201105_DiRY_c6737940edb79c8e59f605ae6c6b577c/
What is the current behavior?
What is the expected behavior?
It should work fine as the SVG actually has dimensions.
To put this into context, the markup in question is the result of the new Next.js Image
component that , as you may be aware, was developed with collaboration with your team.
See the docs at https://nextjs.org/docs/basic-features/image-optimization
This is the Next.js/React markup:
<Image
src="/images/main-logo.png"
alt="quiamo logo"
className={classes.branding}
width="180"
height="60"
loading="eager"
priority
/>
And the corresponding HTML:
Environment Information
- Affected Channels: webpagetest.org
- Lighthouse version: as per webpagatest.org
- Chrome version:
- Node.js version:
- Operating System:
Related issues
Issue Analytics
- State:
- Created 3 years ago
- Reactions:82
- Comments:20 (8 by maintainers)
Top Results From Across the Web
[Fix] Image Elements do not have explicit width and height ...
In this tutorial, we are going to fix Image Elements do not have explicit width and height in GeneratePress WordPress Theme.
Read more >Image elements do not have explicit width and height
Short Answer. Add the image's native width and height in pixels as attributes on the image. This lets the browser calculate the aspect...
Read more >Quick Tips: How to fix "Image elements do not have explicit ...
Option 1 - define the width and height of the image using the width and height attributes. ... The first option is to...
Read more >Use explicit width and height on image elements for svg logo
Hi,. To remove this warning, you can add width and height attribute to your site logo. To do that, you can use the...
Read more >SVG Logo file – no explicit width and Height - WordPress.org
Is there any way to exclude specific image/container from auto-exclude list if that is the case ? The page I need help with:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
any ETA on a fix?
+1. Let’s do this and comment it out. It’s a compromise solution but works.