ember Error: Compile Error: is not a helper

匆匆过客 提交于 2021-01-27 07:30:53

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!