Property assignment expected. javascript

Hi,
I have got the following error message:
Property assignment expected. javascript

I am new to hugo and the syntax.. maby someone can explain me it a bit. :sweat_smile:

You are using an IDE (VSCode?) that is too clever for what you are doing. The file you are working in might be a Golang template file, but VSCode is parsing it as *.js file because it has a js file extension. So VSCode expects you to write Javascript, but what it doesn’t know what {{ counter }} means and would expect something like "blafasel".

What you CAN do is to install some form of Golang template plugin that does take care of this and would also parse the file as Golang template.

Or, you ignore it, because the error centers on a Golang tag ({{ something}}) and the error is in the realm of javascript (see the right side of the error message popup).

Long story short: Not a Hugo issue, but your IDE not knowing what it works with.

This is a screenshot of the plugins I am using in connection with Go and Hugo (ignore Frontmatter, it’s not about Golang). (If it’s VSCode)

Thanks,
I thought that there is a trick or I miss something.

I stay with the error :slight_smile:

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