I currently have a child package which adds an email alert using an object created by the parent package. The parent package has no workflows at all, there's no directory named workflows/ either and installing the package and checking the components shows no workflows visible.
However, when I try to build the package, I always get a very strange error:
$ sfdx force:package:version:create --package ChildPackage --path force-app --installationkey XXXXX --wait 10 --definitionfile config/project-scratch-def.json
(truncated)
ERROR running force:package:version:create: You're trying to include Workflow namespace__Application__c in Package ver 0.2. This component already exists in Package ver 0.1, which Package ver 0.2 depends on. You can't include the same component in both packages.
I assume that Package ver 0.2 is the child object and Package ver 0.1 is the parent object which matches their actual version.
Details about the environment:
- Both packages are attached to the same dev hub
- Both packages created with this command:
sfdx force:package:version:create --package PackageName --path force-app --installationkey XXXXX --wait 10 --definitionfile config/project-scratch-def.json
- I'm trying to install them to a temporary scratch org - the parent package installs fine, the child package fails
Here's the sfdx-project.json
{
"packageDirectories": [
{
"path": "force-app",
"default": true,
"package": "ChildPackage",
"versionName": "ver 0.2",
"versionNumber": "0.2.0.NEXT",
"dependencies": [
{
"package": "ParentPackage",
"versionNumber": "0.1.0.LATEST"
}
]
}
],
"namespace": "namespace",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "47.0",
"packageAliases": {
"ChildPackage": "0HoXXX",
"ParentPackage": "0HoXXX",
"[email protected]": "04tXXX",
... multiple versions of ChildPackage ...
}
}
Here is the project-scratch-def.json:
{
"adminEmail": "XXX",
"edition": "Developer",
"features": [
"Workflow",
"Communities",
"Sites"
],
"settings": {
"lightningExperienceSettings": {
"enableS1DesktopEnabled": true
},
"communitiesSettings": {
"enableNetworksEnabled": true
}
}
}