function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kiran Kumar 551Kiran Kumar 551 

Not able to Created Dev Hub on existing package

Hi All,

We have existing Salesforce application in app exchange, now we are planning to us SalesforceDX for code movement into our packaging org. But when we are trying to enable Dev Hub in our packaging org we are facing an error. Can you please support on this how do we proceed. Below is the error message :

Error : you can't enable dev hub in a developer edition org with a registered namespace

Our scenario is we want to use SalesforceDX in order to deploy the code from Visual studio code to packaging org with our namespace, so that we don't face any namespace challenges while deploying.

Thank you in Advance
SwethaSwetha (Salesforce Developers) 
HI Kiran,

You are encountering expected behavior, as documented here:

Enable Dev Hub in Your Org:
https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_enable_devhub.htm
>> "You can define a namespace in a Developer Edition org that isn’t your Dev Hub, and you can enable Dev Hub in a Developer Edition org that doesn’t contain a namespace." <<
You will need to use a different Dev org for salesforce DX.

Dev Hub is currently not supported in Managed Package Development org.
You need to use a org for scratch orgs, where namespace is not registered.

Dev hub is GA now so all of the PBOs should have it. Here are instructions on how to get a PBO if you don't have one yet: https://partners.salesforce.com/s/education/general/Partner_Business_Org

If it turns out that your PBO doesn't have Dev Hub installed (per the setup guide here: https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_enable_devhub.htm) then please log a new case with your PBO Org Id to get this enabled.

Hope it answers your query! Please mark the answer as best if it helps.