AMP - How to solve "A tag on this page requires an AMP component 'script' tag, which is missing" for amp-iframe

I have several iframes on my website due to affiliation with Amazon. However my Google Search Console recently gave me the error:

A tag on this page requires an AMP component 'script' tag, which is missing

I had no idea what this meant, I do not know much about the amp project other than my blog has an amp version of every post (at /amp). So I started searching and I found out that there is a specific list of amp components. These are components that are able to run on an amp page, such as an amp-iframe, which is the amp equivelant of an iframe. The components require scripts to run, for example the script needed for the "<amp-iframe>" tag is the following:

<script async custom-element="amp-iframe" src=""></script>

This is the reason I got the error, I had not included this script on my page. So if you have the above mentioned error you are likely missing a script for an AMP component on your website. Searching for amp components in the HTML of your page may reveal which is missing a script.

I hope this post helps you solve your issue at hand, let me know if it did, in the comments down below! :)

Ghost blog specific

My error was further confusing as Ghost blog automatically include these components when needed. I believe the error that I had was that my amp-iframe was too close to the top of webpage, the rules for amp-iframes are that:

"An amp-iframe may not appear close to the top of the document (except for iframes that use placeholder as described below). The iframe must be either 600 px away from the top or not within the first 75% of the viewport when scrolled to the top, whichever is smaller."

I believe this is another issue that I ran into, I moved the iframe down the page and everything worked out.