Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
All errors
Lightning · LWC

Action failed: c:myComponent$controller$myAction [<JS error message>]

An Aura component's client-side JavaScript controller threw an exception. The error message is wrapped in `Action failed: c:component$controller$method` for the framework, but the *interesting* part is the inner JS error. Look at the bracketed message, not the prefix.

Also seen asAction failed: c:·controller error aura·Action failed: c:myComponent$controller·Aura Action failed

Aura's error reporting wraps every JavaScript exception with a framework-shaped prefix. The prefix is mostly noise — what matters is the JavaScript error inside the brackets.

How to read it

Action failed: c:contactForm$controller$saveAction [Cannot read property 'fields' of undefined]

Three pieces:

PartMeaning
c:contactFormThe Aura component namespace and name
$controller$saveActionThe function in the controller (controller.js) that threw
[Cannot read property 'fields' of undefined]The actual JS exception

The bracketed JS error tells you what to fix. In this case: something is undefined when you tried to read .fields from it. Same family of bug as Cannot read properties of undefined in LWC — Aura just wraps it.

The two common causes

1. A response from a server-side @AuraEnabled method failed

Aura controllers are async. The $A.enqueueAction(action) call doesn't wait for a response; the callback runs later. If your callback assumes data shape that didn't arrive (because the Apex method threw), you get the JS error.

// component.js controller
saveAction: function(component, event, helper) {
    var action = component.get('c.saveContact');
    action.setCallback(this, function(response) {
        var state = response.getState();
        if (state === 'SUCCESS') {
            var data = response.getReturnValue();
            component.set('v.fields', data.fields);  // 💥 if data is undefined
        }
    });
    $A.enqueueAction(action);
}

Always check state and inspect response.getError() before assuming success:

if (state === 'ERROR') {
    var errors = response.getError();
    console.error('Apex error:', errors);
    return;
}

2. Something accessed in the wrong lifecycle phase

Reading component.get('v.foo') before init has run, or accessing a child component before it's rendered, returns undefined. The fix is to move the work to init (for component setup) or afterRender (for DOM-touching work) or to a server callback (for data-dependent work).

Aura is being deprecated

If you're touching this code in 2026, consider rewriting the component as LWC. Aura is in maintenance mode; new development should be in LWC, and existing Aura should be incrementally migrated. The platform plans to retire Aura but hasn't named a date.

In the meantime, the fix for any specific Aura Action failed error is:

  1. Open the component's controller.js
  2. Find the function named in $controller$X
  3. Add console.log (or set a breakpoint) right before the line that fails
  4. The JS error tells you what's missing

For client-side exceptions, the Browser DevTools console has the full stack — the wrapped message is what Aura displays, but DevTools shows the original JS stack.

Related dictionary terms