Forums › Forums › Bug Reports › AMP Issues! › Reply To: AMP Issues!
-
Hi @iqiqi ! Upon further inspection, the “path” tag referred to in the error message is already a descendant of an “svg” tag. However, something else was added inside the svg tag. Take a look at the following excerpt from the page you linked:
<svg xmlns="http://www.w3.org/2000/svg" height="25" width="25" viewbox="0, 0, 512, 512">
<div class="td-a-rec td-a-rec-id-content_inline_mob ">
<amp-auto-ads type="adsense" data-ad-client="ca-pub-3979207500429905" class="i-amphtml-layout-container" i-amphtml-layout="container">
</amp-auto-ads>
</div>
<path fill="currentColor" d="M512 199.652c0 23.625-20.65 43.826-44.8 43.826h-99.851c16.34 17.048 18.346 49.766-6.299 70.944 14.288 22.829 2.147 53.017-16.45 62.315C353.574 425.878 322.654 448 272 448c-2.746 0-13.276-.203-16-.195-61.971.168-76.894-31.065-123.731-38.315C120.596 407.683 112 397.599 112 385.786V214.261l.002-.001c.011-18.366 10.607-35.889 28.464-43.845 28.886-12.994 95.413-49.038 107.534-77.323 7.797-18.194 21.384-29.084 40-29.092 34.222-.014 57.752 35.098 44.119 66.908-3.583 8.359-8.312 16.67-14.153 24.918H467.2c23.45 0 44.8 20.543 44.8 43.826zM96 200v192c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V200c0-13.255 10.745-24 24-24h48c13.255 0 24 10.745 24 24zM68 368c0-11.046-8.954-20-20-20s-20 8.954-20 20 8.954 20 20 20 20-8.954 20-20z"></path>
</svg>
Google’s AMP testing tool doesn’t expect non-SVG-related tags (e.g. g, path, circle) inside the SVG tag, and placing them (in this case, the amp-auto-ads tag and its parent element) ahead of the path tag triggers the error message, since the presence of non-SVG-related tags automatically closes the SVG tag and renders the tags that supposed to be inside it outside the SVG tag. If those elements came after the path tag, no error messages would come up.
Finding out the plugin/script/setting that causes this and preventing them from adding tags inside SVG elements should fix this.