Skip to content

Apex action of a Lightning component not found

Detection

  • RegExp: Error (.*) Unable to find Apex action (class|method) referenced as '([^']+)'

Examples

  • Error invoiceList Unable to find Apex action class referenced as 'InvoiceController'.

Resolution

Component {1} calls Apex {2} {3}, which is not in the target org, or is not callable from a component.
- Deploy the Apex class: retrieve it from your org with the Metadata Retriever of VS Code, commit it and save your User Story: sfdx-hardis adds it to manifest/package.xml
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- Check that the method is static and @AuraEnabled, in a public or global class, and the import in {1}: @salesforce/apex/ClassName.methodName

Comments