问题
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?
回答1:
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.
回答2:
From the documentation:
Helpers allow you to add additional functionality to your templates beyond what is included out-of-the-box in Ember. Helpers are most useful for transforming raw values from models and components into a format more appropriate for your users.
It looks like you are using a non-defined helper. So please look through (and maybe provide) some more of your log output. You are probably using an undefined helper in one (or multiple) of your .hbs
-files.
回答3:
component and file name must be the same. This solution worked for me.
来源:https://stackoverflow.com/questions/47283645/ember-error-compile-error-is-not-a-helper