function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mohau TwalaMohau Twala 

Failed to save AccountSearch.cmp: No EVENT named markup://c:AccountsLoaded found : [markup://c:AccountSearch]: Source

HI I an getting this error : Failed to save AccountSearch.cmp: No EVENT named markup://c:AccountsLoaded found : [markup://c:AccountSearch]: Source when trying to save this code below:
<aura:component controller="AccountSearchController">
    <aura:registerEvent name="accountsLoaded" type="c:AccountsLoaded"/>
    <aura:handler name="init" value="{!this}" action="{!c.onInit}"/>
    <aura:attribute name="searchTerm" type="String" default="San Francisco"/>
    <lightning:card title="Account Search" iconName="standard:search">
        <div class="slds-form slds-p-around_x-small">
            <lightning:input
                label="Search"
                variant="label-hidden"
                value="{!v.searchTerm}"
                placeholder="Search by name, phone, website, or address"
                onchange="{!c.onSearchTermChange}"/>
        </div>
    </lightning:card>
</aura:component>
Dinesh GopalakrishnanDinesh Gopalakrishnan
Hi Mohau,

Please make sure that you created a component or application event called "AccountsLoaded.evt"  in your sandbox before saving the lightning component.

<aura:event TYPE='.....'>
.....
</aura:event>

Kindly Mark this as a Best Answer if you Find this Useful!

Thanks,
DineshKumar Gopalakrishnan
Abdul Azeez 4Abdul Azeez 4
You can resolve this error by Creating an Event with the name AccountsLoaded in the same way you created this Aura Component File>New>Lightning Event.

For creating an Event please refer this (https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/events_component_example.htm)

Hope this resolves the issue