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

1 Answer 1



an @AuraEnabled method has to be static.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .