#Attempted to resolve a modifier in a strict mode template, but that value was not in scope: on:

1 messages · Page 1 of 1 (latest)

coarse badger
#

I am getting this if remove the static field in this gjs file.
Should I keep adding this static fields ?

Please let us know any config change for the same.

This is happending in a V2 addon.

import Component from '@glimmer/component';
import { on  } from '@ember/modifier';
export default class MyComponent extends Component {
   handleClick() {
    alert('Clicked!');
  }
  static on = on;

 <template>
    <div>
      <h1>Hello, {{@name}}!</h1>
    <button {{on "click" this.handleClick}}>Click me</button>
    </div>
 </template>
}
coarse badger
#

@steel dew
Could you please help me with this?

silver mango
#

Also check the version of babel-plugin-ember-template-compilation. If it isn't latest see if updating it resolves the problem.

steel dew
coarse badger
steel dew
#

did you remove the static on?