The [js] part seems as if your “smart” IDE tries to check this as HTML with embeded JavaScript. Turn that check off, it can’t work with template files, as they often only contain partial or invalid HTML and JavaScript before the actually got rendered.
What editor are you using? And is your code the same as mine? I’d like to try to replicate it locally so I can add a note to the article so others don’t get confused as well
I use VS Code and to solve this for me, thanks to NobbZ, is to set up “html.validate.scripts”: false, but there is one problem, the VS Code formater tool is going to cascade the code and in the browser console you can see that error. Or you remove html formater in html files, or, what i did, change the name to *.gohtml (you also lose the formater)