-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AMP Optimizer: Why occur the error related to PreloadHeroImage
?
#894
Comments
Can you please provide a code sample. |
@sebastianbenz By the way, if don't use <!DOCTYPE html>
<html amp>
<head>
<title>Sample Page</title>
<meta name="description" content="sample page" />
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0"/>
<link rel="canonical" href="https://amp.dev/">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style>
<noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
</head>
<body>
<amp-img
src="https://amp.dev/static/samples/img/story_dog2.jpg"
width="1"
height="1"
layout="responsive"
alt=""
/>
</body>
</html> then, run |
Thanks - that helps! Yeah, looks like the validator doesn't support this yet for stories. |
Filed ampproject/amphtml#29850 |
I use amp-optimizer with NextJS. The error occur in the page that used
<amp-story>
Before I update
@ampproject/toolbox-optimizer
to 2.6.0, the error is not occured.Maybe this error related to
PreloadHeroImage
. Because if I turn off thePreloadHeroImage
, this is fine.Could you tell me why I am getting this error?
Reproduction
Steps to reproduce the issue
@ampproject/toolbox-cli optimize story-sample.html > story-optimized.html
amphtml-validator story-optimized.html
What's the expected result?
What's the actual result?
The parent tag of tag 'img' is 'amp-img', but it can only be 'i-amphtml-sizer-intrinsic'.
use versions
The text was updated successfully, but these errors were encountered: