Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ember Error: Compile Error: is not a helper

Tags:

ember.js

I got the following error while developing our front-end with Ember.js:

ember Error: Compile Error: '...' is not a helper

What is the meaning of this error?

like image 270
Ahmet Emre Kılınç Avatar asked Dec 13 '22 19:12

Ahmet Emre Kılınç


2 Answers

Reason

Ember throws this error if there is no component or helper with the given name is not found in your project or your dependent addons.

How to solve

You should check the name of the component or helper that you have written (possible errors are spelling errors or writing directory structure of the component incorrectly).

This twiddle shows example of this error message when the component my-component is called as {{my-component2 x=x}} instead of {{my-component x=x}} mistakenly.

like image 143
Ahmet Emre Kılınç Avatar answered Dec 24 '22 19:12

Ahmet Emre Kılınç


This error can also happen in older (pre-Octane) versions of Ember if you have your component in all the right places, but your component doesn't have a dash in its name. As per the docs, components are required to have at least one dash in their names:

Components must have at least one dash in their name. So blog-post is an acceptable name, and so is audio-player-controls, but post is not. This prevents clashes with current or future HTML element names, aligns Ember components with the W3C Custom Elements spec, and ensures Ember detects the components automatically.

If you try to create a component without a dash in its name, Ember won't find it and will give you this error.

It appears this requirement has been lifted in more recent versions of Ember, where components start with a capital letter to distinguish them from native HTML elements.

like image 21
cincodenada Avatar answered Dec 24 '22 21:12

cincodenada