We are developing Lightning components code on Organization with a Namespace Prefix.

The issue is when I retrieve Aura components using Force.com IDE or Force.com Migration Tool(latest versions), my Namespace Prefix has been reset to default namespace "c".

For example in Dev Console I see my components like this:

<aura:component access="global" controller="mynamespace.mycontroller" implements="forceCommunity:availableForAllPageTypes">
    <aura:dependency resource="mynamespace:mycomponent" type="APPLICATION"/>
    <aura:registerEvent name="getcat" type="mynamespace:myevent"/>
    <aura:handler event="mynamespace:myNavigationEvent" action="{!c.linkClick}" />

But after retrieving it, I see this:

<aura:component access="global" controller="mycontroller" implements="forceCommunity:availableForAllPageTypes">
    <aura:dependency resource="c:mycomponent" type="APPLICATION"/>
    <aura:registerEvent name="getcat" type="c:myevent"/>
    <aura:handler event="c:myNavigationEvent" action="{!c.linkClick}" />

It will block us to use Source Control System and Deployment Tools. We cannot fully use branch org feature.

UPD: Opened case to SF support. Was not helpful.

Namespace Usage Examples and Reference doc

Source Control System and Deployment Tools issue means: every deployment should be followed by manual editing of all components, getting back my reset namespace prefix.

Any suggestions would be appreciated.

  • May I ask what you mean when you say that this behavior blocks you from using source control and Branch Orgs? – dsharrison Nov 14 '16 at 20:08
  • Use case: Your team working on a package. If it more than 2 devs, doing work together on a packaging org is very uncomfortable. So each dev has its on dev org (branch feature, same namespace prefix as on packagin org). Then, if dev#1 wants to introduce his changes to the package, he retrieves components locally, do some git stuff and create pull request. The problem is, in his pr there is no any namespaces, thus changes can not be just deployed to a packaging org. So dev#1 should add prefix manually to each component in his pr and only then upload it. – Denis Pereverzev Nov 15 '16 at 10:14
  • we use many branch orgs and the 'c:' namespace in our lightning components without issue. The Metadata API should allow deployments to your packaging org using the standard 'c' namespace. Are you getting errors when deploying that code? Just as a reference our deployments to the packaging org are performed via the Force.com Migration Tool (ant) from Jenkins. – dsharrison Nov 16 '16 at 16:34
  • No errors on deploy. But if I want to include my components in a package I must explicitly specify my namespace prefix. So after deploy I should open all components and change <c:myComponent /> to <yournamespace:myComponent />, <aura:component controller="ExpenseController"> to <aura:component controller="yournamespace.ExpenseController"> and so on. – Denis Pereverzev Nov 17 '16 at 7:12
  • You should not need to do that for a managed package; your components know their own namespace and 'c' should be fine. Are you seeing otherwise? – dsharrison Nov 17 '16 at 17:58

Try retrieving with your migtration tool a packaged metadata:

<target name="retrievePkg">
    <sf:retrieve username="${sf.username}" password="${sf.password}" sessionId="${sf.sessionId}" serverurl="${sf.serverurl}" maxPoll="${sf.maxPoll}" retrieveTarget="retrieveOutput" packageNames="${sf.pkgName}"/>

And don't forget to name your sf.pkgName in the build.properties file

  • used that, it didn't work – Denis Pereverzev Nov 15 '16 at 10:07
  • Retrieving package content the same as unpackaged one, without prefixes. – Denis Pereverzev Nov 15 '16 at 10:17
  • can you please share the package.xml and build.xml files? – Itai Shmida Nov 16 '16 at 6:48
  • Here is my taskdef for retrieve package contents. ${sf.pkgName} specified in prop file. <target name="retrievePkg"> <delete dir="${sf.src.metadata.root}"/> <mkdir dir="${sf.src.metadata.root}"/> <sf:retrieve username="${sf.src.username}" password="${sf.src.password}" serverurl="${sf.src.serverurl}" maxPoll="${sf.maxPoll}" retrieveTarget="${sf.src.metadata.root}" packageNames="${sf.pkgName}" apiVersion="${apiVersion}" /> </target> – Denis Pereverzev Nov 17 '16 at 7:23
  • It looks ok. what is the api version that you give? – Itai Shmida Nov 17 '16 at 7:27

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.