I’m using 3.13 and trying to modernize my code with decorators, tracked properties, etc. So far, so good, but I am having a problem with the new “on click” event handler format.
I’m not 100% sure, but since you are on Ember 3.13, and the code seems to be running fine I think this is an error thrown by the template linter. This has been fixed on more recent versions, I believe an update of ember-template-lint should do the trick for you.
In your snippet {{on is an element modifier. An element modifier is a type of userland object that is invoked by any “mustache statement” that is inside an element that isn’t part of an attribute / assignment.
Well, I was trying to get rid of that super-annoying browserslist: caniuse-lite is outdated error message that has been appearing a dozen times every time I start my local server. So I did an npm-update-all
That produced a slew of error messages that made my heart sink, but I checked out the package.json file and noticed 2 of the addons were older than the previous versions. (Because the originals were beta versions, and the npm-update-all backed them down to non-beta ones.)
So I reverted those 2 packages, did an npm install and voila! Not only did the browserslist: caniuse-lite is outdated error messages disappear, but so did the compiler error messages that I asked about.
Not sure why they went away, but I’m too happy to care. This is the kind of updating and maintenance that can easily cost someone a day or more (we’ve all “Been there, Done that”) and I am thrilled that I just killed 2 birds with 1 stone.
And since it’s Friday afternoon, this must be God’s way of saying, It’s Miller Time, Larry. So have a great weekend everyone!
And especially that @rwjblue guy, who (a) responded while I was typing this, (b) is always helping others, and (c) never seems to sleep.
@rwjblue: thanks for the “on” explanation - much appreciated.
And I think you are right about it being the linter. I don’t have ember-template-lint in my package.json file, but I do have babel-eslint and that did get updated in the npm-update-all.