1

I am trying to complete the Trailhead module on Aura comps but ran into an error.

COMPONENT markup://c:campingList is missing required attribute 'title'

There is no 'title' attribute in my CampingList.cmp, however. Why is this error being thrown? Here is the code:

<aura:component >
<aura:attribute name="items" type="Camping_Item__c[]"/>
<aura:attribute name="itemList" type="Camping_Item__c" default = "{'SObjectType':'Camping_Item__c','Quantity__c':'0','Price__c': '0'}"/>

<lightning:card> 
    <lightning:input name="Name" required="true" label="Name" />
    <lightning:input type="number" name="Quantity" required="true" min="1" value="1" label="Quantity - Requires a minimum value of 1" />
    <lightning:input type="number" name="Price" required="true" label="Price"/>
    <lightning:input type="checkbox" name="Packed" required="true" label="Packed"/>

</lightning:card>
</aura:component>
4

You did not set attribute title in card.

If you check docs of lightning:card, title attribute is MANDATORY.

<lightning:card footer="Card Footer" title="Hello">
    <aura:set attribute="actions">
        <lightning:button label="New"/>
    </aura:set>
    <p class="slds-p-horizontal_small">
        Card Body (custom component)
    </p>
</lightning:card>

Here title is Hello

| improve this answer | |
  • Duh! Thank you for the quick response. For future reference, is there a clearer way to debug this? I feel like the error message was not very helpful. – Rory Sep 18 '19 at 13:52
  • Yes error message is sometimes is not clear. Debugging standard components is very complex. Instead checking documentation would help. – salesforce-sas Sep 18 '19 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.