title: Salesforce Lightning: Error during init [Cannot read property 'apply' of undefined]
body: <p>I'm stuck with a Lightning component that doesn't render. I get a strange error immediately: This page has an error. You might just need to refresh it. Error during init [Cannot read property 'apply' of undefined].</p>
  
  <p>I'm stuck now for a long time and can't figure out what is wrong with the code. Here you can see my code:</p>
  
  <p>Component:</p>
  
  <p></p>
  
  <pre><code>&lt;aura:attribute name="recordId" type="String" default='500b000000cOxah' /&gt;
  &lt;aura:attribute name="case" type="Case" /&gt;
  &lt;aura:attribute name="tasks" type="Task[]"/&gt;
  
  &lt;aura:handler name="init" value="{!this}" action="{!c.doInit}"/&gt;
  
  &lt;c:CaseActivityTrackerHeader /&gt;
  
  &lt;aura:iteration items="{!v.tasks}" var="task"&gt;
      &lt;c:CaseActivityTrackerTimeline task="{!task}"/&gt;
  &lt;/aura:iteration&gt;
  
  &lt;aura:iteration items="{!v.tasks}" var="task"&gt;
      &lt;h3&gt;{!v.task.Subject}&lt;/h3&gt;
  &lt;/aura:iteration&gt;
  
  &lt;h3&gt;{!v.case.Subject}&lt;/h3&gt;
  &lt;h3&gt;{!v.recordId}&lt;/h3&gt;
  
  ({
  doInit: function(component, event, helper) {
      //helper.getCase(component, event);
      //helper.getTasks(component, event);
      // Set the attribute value. 
      // You could also fire an event here instead.
      component.set("v.recordId", "controller init magic!");
  }
  </code></pre>
  
  <p>})</p>
  
  <p></p>
  
  <p>App</p>
  
  <pre><code>&lt;aura:application extends="force:slds"&gt;
  
  &lt;c:CaseActivityTracker /&gt;
  
  &lt;!-- 
  &lt;c:camping /&gt;
  --&gt;
  </code></pre>
  
  <p></p>
  
  <p>I really somebody can help me!
  Thanks in advance :)</p>