{{.Inner | htmlUnescape | safeJS}} appears in a JS template literal

I made a live code editor shortcode,
Which looks something like this,

  <script>
    var editor = ace.edit("editor");
    editor.setTheme("ace/theme/textmate");
    editor.session.setMode("ace/mode/python"); // Default to Python
    var initialContent = `{{ .Inner | htmlUnescape | safeJS }}`;
    editor.setValue(initialContent.trim()); 

But when deploying hugo, I get this error
{{.Inner | htmlUnescape | safeJS}} appears in a JS template literal

Could anyone give me any suggestions?

Hugo version?

My hugo version is

╰─❯ hugo version
hugo v0.124.0-629f84e8edfb0b1b743c3942cd039da1d99812b0+extended darwin/arm64 BuildDate=2024-03-16T15:44:32Z VendorInfo=brew

Where are you deploying and how? I suspect you are building your site for deployment with v0.120.4 or earlier.