I when I press button, I get a lightning alert popup with an error:

Unfortunately, there was a problem. Please try again. If the problem continues, get in touch with your administrator with the error ID shown here and any other related details.Something has gone wrong. Cannot read property '$getActionDef$' of undefined. Please try again.


public class AuraCtrl {    
    public String getFoo() {
        return 'OLOLO';


<aura:component controller="AuraCtrl" implements="force:appHostable,flexipage:availableForAllPageTypes">
    <aura:attribute name="barAttr" type="String"/>
    <ui:inputText aura:id="barId" label="Bar input" value="{!v.barAttr}"/>
    <ui:button label="Press for Bar!" press="{!c.doGetBar}"/>

JS Ctrl:

    doGetBar : function(component, event) {
        var action = component.get("c.getFoo");
        // another code does not matter because all breaks with first line


an @AuraEnabled method has to be static.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.