简体   繁体   中英

Lightning Component not showing on Lightning Tab

I am not able to see my lightning component when trying to create a lighting tab. Something is wrong with one of the components -

I moved the component and tab using salesforce dx and when editing the component. I am getting below error. I seems like one of the component is throwing an error when i am trying to edit the record -

Error = Review all error messages below to correct your data. You can only create lightning tabs for AuraDefinitionBundles containing a component that implements force:appHostable and has no required attributes without a default value. (Related field: Content)

Observation - When i remove the attribute from parent component and child component than its working and i am able to save the tab. Something is not correct with my component initiation.

Code in parent Component -

<aura:if isTrue="{!!v.customTab}">
<div aura:id="defaultTabContent" class="slds-show">
    <c:ApiRequestFieldMapping custom="false" objectName="Credit_Report__c"/>
</div>
</aura:if>
<aura:if isTrue="{!v.customTab}">
<div aura:id="customTabContent" class="slds-hide">
    <c:ApiRequestFieldMapping custom="true" listSObjects="
    {!v.listSObjects}" message="Select object from drop-down." 
    messageClass="Info"/>
</div>

Code in Child Component -

<aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
<aura:registerEvent name="handleModelVisiblity" type="c:HandleModel"/>
<!-- attributes -->
<aura:attribute name="custom" type="Boolean"/>
<aura:attribute name="objectName" type="String"/>
<aura:attribute name="listSObjects" type="String[]"/>
<aura:attribute name="message" type="String"/>
<aura:attribute name="messageClass" type="String"/> 
<aura:attribute name="listSObjectFields" type="String[]" 
required="false"/>
<aura:attribute name="customObjectName" type="String" 
required="false"/>
<aura:attribute name="listWrapper" 
type="RequestMappingWrapper.MappingRecords[]" required="false"/>

Already Tried - 1. My component is already implementing "force:appHostable" interface. 2. The component us using latest version.(40.0) 3. Have already tried creating the components. 4. My org has my domain enabled and also have namespace.

I have fixed the issue. I have removed the reference to inner class in one of the attribute. Changed "RequestMappingWrapper.MappingRecords[]" to "RequestMappingWrapper[]".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM