Unable to find Apex action class referenced as 'ContactController'.
can someone help me i follow all the steps but im stuck with this error Thank you!
#Trailhead Challenges #Salesforce Developer #Apex #Apex Class #Trailhead #Trailhead Superbadges #Trailhead Playground #Trailhead Developer Org
Hi,
The error you are facing "Unable to find Apex action class referenced as 'ContactController'" indicates Salesforce cannot locate the ContactController Apex class referenced by a Lightning Web Component (LWC) or Aura Component. To resolve this, verify the class exists in Setup > Apex Classes or Developer Console; if missing, create it with a method annotated with @AuraEnabled(cacheable=true) (e.g., public static List<Contact> getContacts()) to ensure LWC or Aura can call it.
If the class exists, check whether the method is annotated with @AuraEnabled , If not then do it.
Check the LWC’s JavaScript for the correct import (e.g., import getContacts from '@salesforce/apex/ContactController.getContacts') or the Aura component’s controller="ContactController" attribute, ensuring no typos or case mismatches. Confirm your user/profile has access to the Apex class via Setup > Profiles > Apex Class Access.
If this resolves your query mark the answer as helpful!
Thanks.