Brandi
Brandi

Reputation: 171

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

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?

Upvotes: 3

Views: 902

Answers (1)

Brandi
Brandi

Reputation: 171

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...

Upvotes: 1

Related Questions