"packageDirectories": [
  "path": "force-app",
  "default": true,
  "ancestorId" :"05i7F000000CaRgQAK",
  "id": "0Ho7F000000GmbCSAS",
  "versionName": "Version 1.0",
  "versionNumber": "1.0.0.NEXT"
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "42.0"

In Salesforce DX as per documentation ancestorId is the package version which gets installed when we create a new scratch org. But no packages are being installed!

Here I have placed ancestorId in sfdx-project.json but when a new scratch org is created that ancestor package is not installed.

Is there any other configuration that needs to be done before it works?

1 Answer 1


I think there is a context issue. Salesforce documentation doesn't say ancestor version will be automatically installed it says it will be included. 2GP managed package development depends on managed metadata integrity. That being said for example you cannot delete a managed component or you cannot change isExposed in lwc definition from true to false. AncestorId is being used to make sure you are not breaking that metadata integrity so that when you push your metadata into your scratch org which was created via project.json containing an ancestorId or when you try to release a new version metadata verification will be handled by that ancestor scope.

You must log in to answer this question.

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