Non-text context error (Hugo 122)

I get a non-text context error with hugo server

The error causing block is:

<script id="__bs_script__">//<![CDATA[
document.write("<script async src='http://localhost:3000/browser-sync/browser-sync-client.js?v=2.18.13'><\/script>".replace("HOST", location.hostname));
//]]></script>  

(a PHP commenting thingy, it worked in a previous Hugo version)

What’s the fix? (it’s only temporary, will move to Disqus soon)

{{ $s := `//<![CDATA[
  document.write("<script async src='http://localhost:3000/browser-sync/browser-sync-client.js?v=2.18.13'><\/script>".replace("HOST", location.hostname));
  //]]>`
}}

<script id="__bs_script__">{{ $s | safeJS }}</script>
1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.