3
votes

I am using gatsby js to build my static amp page and you can see the final html output in the search console. You can see that the generated html passes amp validation. That test passes because I copy and pasted the generated html.

However the website fails because on page load the official amp script <script async src="https://cdn.ampproject.org/v0.js"></script> adds ineligible tags. If I remove the script, the html stays the same. There are other scripts but I am 99% sure it's ^ one because I tried removing them one by one.

The script adds things like amp-version i-amphtml-sizer in the css and changes other things on the page. I am not sure why it would add these tags because v0.js is recommended by amp.

You can see the failing page here. https://search.google.com/test/amp?id=aClwacaTtbw5q7-Dm3glPg&skip_amp_follow=true

If someone can point me to the original amp v0.js I will be truly grateful. The CDN version is uglified+transpiled and it's really hard to debug my issue.

1
Hi, what about this url parameter? Does it show errors in developer console? amp.dev/documentation/guides-and-tutorials/learn/… - Miroslav Papírník
No, the validator passes. validator.ampproject.org/… - Yasin Yaqoobi
1) download repo from github.com/ampproject/amphtml 2) run 'yarn install' 3) run 'gulp' (it starts server on localhost:8000) There are 3 options in settings (JavaScript Serve Mode): - Default - Unminified AMP JavaScript is served from the local server. For local development you will usually want to serve unminified JS to test your changes. - Compiled - CDN - Miroslav Papírník
Does it solve your problem? - Miroslav Papírník
Thank you for taking the time but I actually found the original file in Amp-Html repo. The problem was cache related. - Yasin Yaqoobi

1 Answers

2
votes

This was caused by amp cache. I had to follow this guide to invalidate the cache for all my amp pages.

https://developers.google.com/amp/cache/update-cache.