Skip to content

Namespace not available in the target org

Detection

  • RegExp: Error (.*) Cannot create a new component with the namespace: (\w+)

Examples

  • Error acme__Score__c Cannot create a new component with the namespace: acme. Only components in the same namespace as the organization can be created through the API

Resolution

{1} uses namespace {2}, and the target org has neither this namespace nor the package that brings it.
- Declare the package in the Installed Packages panel of VS Code with the Deployments flag: sfdx-hardis installs it in the major orgs before deploying (https://sfdx-hardis.cloudity.com/salesforce-devops-work-on-user-story-install-packages/)
- If a Pull Request validation fails because the package is missing, set installPackagesDuringCheckDeploy: true in .sfdx-hardis.yml
- Or remove the {2}__ items from your sources: sf hardis:project:clean:manageditems --namespace {2}

Comments