4

Update 3

Issue is still there even for non dynamic components. If someone can provide me tips and tricks.


I have three components in my package:

A is a component used in app toolbar. It works and is also available on app builder(useless).

<aura:component description="A"
                access="global"
                implements="force:appHostable,
                            flexipage:availableForAllPageTypes">
</aura:component>
  • AppHostable was required for packaging (else error).
  • AvailableForAllPageTypes was required for toolbar.

B is a component used on record page level. It is not available in package components.

<aura:component description="B" 
                            implements="force:hasRecordId,
                            flexipage:availableForRecordHome,
                            flexipage:availableForAllPageTypes,
                            force:hasSObjectName"
                access="global"
                controller="BCtrl"
>
</aura:component>
  • AvailableForRecordHome was required for record page.
  • AvailableForAllPageTypes has been added for test purpose but is not required

C is a component used on record page level. It is not available in package components.

<aura:component description="C"
                implements="force:hasRecordId,
                flexipage:availableForRecordHome,
                flexipage:AvailableForAllPageTypes "
                controller="CCtrl">
</aura:component>
  • AvailableForRecordHome was required for record page.
  • AvailableForAllPageTypes has been added for test purpose but is not required

Everything works perfectly on the dev/packaging org where it is from.


UPDATE

  • Yes, myDomain is created and enabled
  • Give access="global" to every component: does not change anything

UPDATE 2

Here is a real tree of dependencies for one of the component:

<!-- The only component displayed on the Record page Account/Contact/Lead -->
<aura:component description="A" 
                implements="flexipage:availableForRecordHome" 
                access="global">

  <aura:dependency resource="markup://c:ComponentB"     type="COMPONENT" />
  <aura:dependency resource="markup://c:ComponentC"     type="COMPONENT" />
  <aura:dependency resource="markup://c:ComponentD"     type="COMPONENT" />
  <aura:dependency resource="markup://c:ComponentE"     type="COMPONENT" />
  <aura:dependency resource="markup://c:ComponentF"     type="COMPONENT" />
  <aura:dependency resource="markup://c:ComponentG"     type="COMPONENT" />

  <c:ComponentB generateDynamic="ComponentC" />
  <c:ComponentB generateDynamic="ComponentD" />
  <c:ComponentB generateDynamic="ComponentE" />
  <c:ComponentB generateDynamic="ComponentF" />
  <c:ComponentB generateDynamic="ComponentG" />

</aura:component >

<aura:component description="B" access="global">

{! v.body }

<!-- JS Create dynamic component from attribute "generateDynamic" -->

</aura:component >

A is still not available in App Builder.

2 Answers 2

2

When you include a component, other dependencies are automatically added to your package. Verify that "B" and "C" are already in the package by checking the component list. Please note that components not marked global can't be used outside of your package, so you may need to change the access level accordingly.

3
  • Hey. Every dependant component is included in package and every component is access="global" but it still does not work.
    – Simonp
    Commented Mar 22, 2018 at 12:51
  • Does the org you are installing it in have MyDomain enabled? Commented Mar 22, 2018 at 13:06
  • Yes of course, else other components wouldn't work
    – Simonp
    Commented Mar 22, 2018 at 13:14
1

Have you tried using the package namespace instead of the default namespace when referencing the components in your update 2 example? Try changing every use of c: to <package namespace>:. According to the documentation, using the default namespace inside a managed package is not fully supported yet:

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/namespace_using_package.htm

3
  • I'd give that the namespace a try, too. Also not sure, if component A needs force:hasRecordId to appear for a record home page. Commented Mar 26, 2018 at 17:19
  • @ChristianSzandorKnapp This is not for appearing but for behaviour of the component.
    – Simonp
    Commented Mar 27, 2018 at 8:34
  • Yes it is already done (namespace)
    – Simonp
    Commented Mar 27, 2018 at 8:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .