Modernizing inline script tags for templates & JS API

Is there an error in the browser console?