Search code examples
javascriptamp-html

amp-live-list fails validation


I am trying to use the <amp-live-list> component but I get this error in the console :

The tag 'script' is disallowed except in specific forms.

I already have this list of scripts on my page with no errors :

    <script async custom-element="amp-carousel" src="https://cdn.ampproject.org/v0/amp-carousel-0.1.js"></script>
    <script async custom-element="amp-twitter" src="https://cdn.ampproject.org/v0/amp-twitter-0.1.js"></script>
    <script async custom-element="amp-youtube" src="https://cdn.ampproject.org/v0/amp-youtube-0.1.js"></script>
    <script async custom-element="amp-instagram" src="https://cdn.ampproject.org/v0/amp-instagram-0.1.js"></script>
    <script async custom-element="amp-pinterest" src="https://cdn.ampproject.org/v0/amp-pinterest-0.1.js"></script>
    <script async custom-element="amp-soundcloud" src="https://cdn.ampproject.org/v0/amp-soundcloud-0.1.js"></script>
    <script async custom-element="amp-vimeo" src="https://cdn.ampproject.org/v0/amp-vimeo-0.1.js"></script>
    <script async custom-element="amp-vine" src="https://cdn.ampproject.org/v0/amp-vine-0.1.js"></script>
    <script async custom-element="amp-user-notification" src="https://cdn.ampproject.org/v0/amp-user-notification-0.1.js"></script>
    <script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
    <script async custom-element="amp-sidebar" src="https://cdn.ampproject.org/v0/amp-sidebar-0.1.js"></script>

BUT it fails when I add the script for <amp-live-list> :

<script async custom-element="amp-live-list" src="https://cdn.ampproject.org/v0/amp-live-list-0.1.js"></script>

Since this component is still in experimental mode, I have tried this :

AMP.toggleExperiment('amp-live-list');

With no success.


Solution

  • As stated in the AMP Experimental Components Page:

    Any AMP file that includes experimental features will fail AMP validation. Remove these experimental components for production-ready AMP documents.

    So regardless of whether or not you have AMP.toggleExperiment('amp-live-list');, the validator will fire an error if you include the script for <amp-live-list>.