How to correctly add Google AMP .js files to my theme
Add the AMP component JS in the &lt;head&gt; section of your document, then it will be ok.

&lt;script async custom-element="amp-sidebar" src="https://cdn.ampproject.org/v0/amp-sidebar-0.1.js"&gt;&lt;/script&gt;



  Extended components are loaded by including a  tag in the head of the document  https://www.ampproject.org/tr/docs/reference/spec