Uncaught ReferenceError: eval is not defined at amp-script

716 views Asked by At

I have added an amp-script to my amp page as described but I am getting the following error message when testing:

[amp-script] Uncaught ReferenceError: eval is not define

I believe is related with the eval() is used to execute JS loaded async from the bundle generated with webpack (I want to avoid to change here), is possible that amp-script doesn't support eval?

I made a simple test and with inline JS and got the same error:

<script id="scroll-listener" type="text/plain" target="amp-script">
   eval('test');
</script>

There is a similar question here: Why is amp-script throwing an reference error for eval? but there isn't any response.

Thanks!

0

There are 0 answers