+ Start a Discussion
Vladyslav KushneyVladyslav Kushney 

Lightning - We couldn't retrieve the component in the main region

I develop managed package, and I pack lightning page and lightning components into package. I have Mydomain established. It uploads successfully, but when I install it in target org, I get an error:
(MyLightningPage) Validation Errors While Saving Record(s) There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "We couldn't retrieve the Mymanespace:Mycomponent component in the main region.".
I can install package with lightning page without that Mycomponent successfully. Component has only two inputs and button and it sends and receives data from Apex controller.
In development org component works absolutely alright.
Mohith Kumar ShrivastavaMohith Kumar Shrivastava
Have you provided global access to the component ? Make sure to set the access for components as "Global"
Vladyslav KushneyVladyslav Kushney

@mohith_shrivastava this is first line of my component

<aura:component controller="MyApexCtrl" implements="flexipage:availableForAllPageTypes" access="global">
Mohith Kumar ShrivastavaMohith Kumar Shrivastava
Can you look if you have handled proper namespacing as per document mentioned here

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/namespace_using_reference.htm
Vladyslav KushneyVladyslav Kushney
@mohith_shrivastava I create lightning page via lightning app builder and the only way to add component to page is drag and drop. But in examples you shared there are like: Component used in markup
<yournamespace:myComponent />

Is there any way to add components to page via xml and metadata?
Vladyslav KushneyVladyslav Kushney
<?xml version="1.0" encoding="UTF-8"?>
<FlexiPage xmlns="http://soap.sforce.com/2006/04/metadata">
    <flexiPageRegions>
        <componentInstances>
            <componentName>MyComponent</componentName>
        </componentInstances>
        <name>main</name>
        <type>Region</type>
    </flexiPageRegions>
    <masterLabel>My Page</masterLabel>
    <pageTemplate>flexipage:defaultAppHomeTemplate</pageTemplate>
    <type>AppPage</type>
</FlexiPage>

@mohith_shrivastava this is flexipage, I can see that in component definition namespace is missing, but when I add namespace: to component name and deploy it, after retriving it is again without namespace.
Mohith Kumar ShrivastavaMohith Kumar Shrivastava
This looks like a SFDC issue currently .Can you open a case and see if they can help you here .