I'm trying to implement a helper method in a Lightning component, but the error that comes up is:

"This page has an error. You might just need to refresh it. Error during init [Action failed: c:EmployerList$controller$doInit > [helper.getEmployerSubset_Lightning is not a function]]"

Here is my component:

<aura:component controller="EmployerListController" implements="forceCommunity:availableForAllPageTypes">
<aura:attribute name="pageIndex" type="Integer" default="0"/>
<aura:attribute name="serverData" type="EmployerListController"/>

<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

<aura:iteration items="{!v.serverData.accountSubset}" var="employer">
    <c:EmployerListCell employer="{!employer}" />
Page {!v.pageIndex+1} of {!v.serverData.numberOfPages}
<!--<lightning:button value="First" onClick="{!firstPage}"/>
<lightning:button value="Previous" onClick="{!previousPage}"/>
<lightning:button value="Next" onClick="{!nextPage}"/>
<lightning:button value="Last" onClick="{!lastPage}"/>-->


And my controller init method:

    doInit : function(component, helper){

And my helper method:

getEmployerSubset_Lightning : function(component) {

    var getServerDataAction = component.get("c.getEmployerListController");
        "pageIndex": 0

    getServerDataAction.setCallback(this, function(response) {
        var state = response.getState();

        if (component.isValid() && state === "SUCCESS") {

            //Update account list
            component.set("v.serverData", response.getReturnValue());


        else {



I can't for the life of me figure out why this wouldn't be working.

  • Don't you Miss à { at the beginning ? Mar 24, 2017 at 23:51

1 Answer 1


I think the problem is with your doInit function. The helper is passed to the function as the third argument:

doInit : function(component, event, helper){
  • 3
    Yep, the second argument is always event, and the system is trying to call an event method that non exist. An event argument must be specified between cmp & helper.
    – Raspi
    Mar 26, 2017 at 10:06

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.