Search code examples
amp-htmllighthouse

AMP website gets Fatal trace logic error in Lighthouse


https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fhcubemarketing-com.cdn.ampproject.org%2Fc%2Fs%2Fhcubemarketing.com

I ran my AMP cache website through Page Speed Insights and under JavaScript execution time I get the error "fatal trace logic error, expected start event, got x"

How is this possible when there is clearly no Javascript as it is a live AMP page?


Solution

  • There is javascript in an AMP page. AMP HTML just restricts the usage of javascript. AMP components still rely on javascript in order to render and function correctly but these components are implemented and then reviewed by the AMP community to ensure that the javascript and user experience comply to AMP's best practices. As someone who just wants to build a webpage using AMP, AMP provides a wide array of components to choose from and configure which doesn't require the user to write any custom javascript.

    amp-script is the component responsible for allowing JS in AMP.