Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Experimental 'amp-script' throws error: Experiment "amp-script" not enabled."

Tags:

amp-html

I am trying to test how powerful the new amp-script feature is. Howver, I am getting this error:

    Experiment "amp-script" is not enabled. log.js:187
    "Experiment \"amp-script\" is not enabled." VM14210 v0.js:125 

I am using the experiment meta tag:

    <meta name="amp-experiments-opt-in" content="amp-next-page,amp-script">

and I have import the script below it:

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

and in the body I have:

    <amp-script layout="container" src="/static/js/ampPiano.js">
     <div id="hello-world"></div>
    </amp-script>

What am I doing wrong?

like image 900
Brandi Avatar asked Sep 04 '26 10:09

Brandi


1 Answers

I was able to make the error go away. Looks like I had to: Enable the experiment via AMP.toggleExperiment('amp-script') in dev console.

I guess this definitely can not be used in production...

like image 105
Brandi Avatar answered Sep 08 '26 07:09

Brandi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!