Counter example error

Hi Im trying to go through counter example but thing there may be an issue with sample code syntax error, unexpected token 'var'

maybe get rid of the stable keyword?

if you follow this tutorial, seems like there is no stable keyword before currentValue

ok let me look again. And I didn’t add link to tutorial but its this one im referencing

Na same thing. Idk I’m just gonna try different tutorials for now cause just trying to get going but Ill look back this later. I’m sure just some updates that caused changes which is fine with me. Means progress is occurring

Actually I’m getting same thing for the tutorial so idk must be something I’m doing

The flexible/stable keyword might be after? Either that or you need private on it before the keyword.

1 Like

Syntax looks fine to me, what version of dfx and vscode-motoko are you running?

1 Like

i updated the links, sorry

can you actually build this? sometimes the language server bugs on something, for me it is some „malformed utf-8“ most of the time. after restarting vscode everything works fine again.


I’m using all latest stuff I think. just downloaded. So 0.5.7 and is this the correct vs code plugin? And dfx build gives same error about var. And tried restarting vs code but same thing

Actually it looks like there are some newer versions but I’m guessing still being worked on so not fully released but I could try using a later version. In which case how would I go about doing that
sh -ci "$(curl -fsSL" I’m guessing sh -ci "$(curl -fsSL" or something. And if I should try this what version should I use?

Hi jar, by chance you happen to have jumped in at a point when the docs may have been updated for a new version that’s not quite yet released, but it isn’t far away.
I think the only thing 0.5.7 isn’t supporting here is the use of the flexible and stable keywords? If you remove those then it should run fine.
If not you can of course try a later version, but bear in mind it isn’t publicly supported (prepend the install command with DFX_VERSION=0.5.11).

1 Like

Re this screenshot, the VScode Motoko extension probably won’t update until you save the file.

When you say 0.5.11 isn’t publicly supported does that mean I wont be able to use it locally and the command wont work for me? Maybe that’s the tungsten version you need to apply to? and to be clear would I run it like sh -ci "$(curl -fsSL DFX_VERSION=0.5.11"

Basically there aren’t any release notes and any questions sent to the support email might go unanswered for that version. The last supported release is still 0.5.7.

Normally the releases have been coming like clockwork along with any help you might need, but things just happen to be slightly out of sync at the moment.

The command is DFX_VERSION=0.5.11 sh -ci "$(curl -sSL" , it should run fine for you if you want to try it.