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
anmi chanmi ch 

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

Hi guys 
i am getting the error Failed to save CampingListForm.cmp: No EVENT named markup://c:addItemEvent found : [markup://c:CampingListForm]: Source . while saving the code in developer console . i do not know where i am doing the mistake
below is my code.


<aura:component >
    <aura:registerEvent name="addItem" type="c:addItemEvent"/>
    
    <aura:attribute name="newItem" type="Camping_Item__c"
     default="{ 'sobjectType': 'Camping_Item__c',
                    'Name': '',
                    'Quantity__c': 1,
                    'Price__c': 0,
                    'Packed__c': false }"/>
        <!-- CREATE NEW ITEM FORM -->
    <form class="slsd-form--stacked">
            <lightning:input aura:id="campingform" label="Camping Name"
                                     name="campingname"
                                     value="{!v.newItem.Name}"
                                     required="true"/> 
                    <lightning:input type="number" aura:id="campingform" label="Quantity"
                                     name="campingQuantity"
                                     min="1"                                    
                                     step="1"
                                     value="{!v.newItem.Quantity__c}"
                                     messageWhenRangeUnderflow="Enter an Quantity that's at least 1."/>
                      <lightning:input type="number" aura:id="campingform" label="Price"
                                     name="campingPrice"
                                     min="0.1"
                                     formatter="currency"
                                     step="0.1"
                                     value="{!v.newItem.Price__c}"
                                     messageWhenRangeUnderflow="Enter an Price that's at least 0.1."/>
                    <lightning:input type="checkbox" aura:id="campingform" label="Packed ?"  
                                     name="campingPacked"
                                     checked="{!v.newItem.Packed__c}"/>
                    <lightning:button label="Create Camping" 
                                      class="slds-m-top--medium"
                                      variant="brand"
                                      onclick="{!c.clickCreateItem}"/>
        </form>
    <!-- / CREATE NEW ITEM FORM -->
</aura:component>
David Zhu 🔥David Zhu 🔥
Please make sure a component or application event called "addItemEvent" is created in your sandbox before saving the lighting component.


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