#Error trying to use fn helper with vite + template-imports

1 messages · Page 1 of 1 (latest)

rotund rune
#

Hi all,

I set up a new app with vite and template-imports but I am getting an error when using the fn helper (the on helper works fine). My components looks like this:

import Component from '@glimmer/component';
import { on } from '@ember/modifier';
import { fn } from '@ember/helper';

export default class BoxComponent extends Component {

  onClick(text: string): void {
    console.log(`click ${text}`);
  }

  <template>
    <div {{on "click" (fn this.onClick "Hello world")}}>click</div>
  </template>
}

I get the error in console: Error: Attempted to load a helper, but there wasn't a helper manager associated with the definition. The definition was: Object

Does anyone have an idea what I am missing?

slim plaza
#

stop vite, delete node_modules/.vite, start vite again

There seems to be a problem at the moment importing new modules whilst the server is running.