HTML Validator Error in <Image> Hydrogen Component After Hydrogen Upgrade (2024.7.4 → 2024.7.9) #2619
Unanswered
sergio-nezhigay
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I recently upgraded Hydrogen from version 2024.7.4 to 2024.7.9 and encountered HTML validation errors related to the component in my code. Here’s the specific part of the code causing the issue:
This renders the following HTML, which is producing the errors:
Errors:
Error: Bad value for attribute height on element img: Expected an integer but saw a decimal instead.
Error: Bad value for attribute srcset on element img: Expected a width descriptor but found a density descriptor (1x).
These errors occur after the upgrade from version 2024.7.4 to 2024.7.9. Before the upgrade, the code worked as expected without these HTML validation issues.
Steps to Reproduce:
Upgrade Hydrogen from 2024.7.4 to 2024.7.9.
Use the component with dynamic loading and sizes attributes.
Validate the HTML using any standard validator tool.
Expected Behavior:
The component should render without producing HTML validation errors.
Current Behavior:
HTML validation fails due to issues with the height and srcset attributes.
The error mentions that the height attribute is expecting an integer, and the srcset attribute requires a width descriptor instead of 1x.
Environment:
Hydrogen version: 2024.7.9
Node.js version: v20.14.0
NPM version: 10.8.3
Beta Was this translation helpful? Give feedback.
All reactions