1

I am trying to create an unlocked package containing a digital experience site but without success, the latest issue that I spent hours trying to solve is that I get the following output :

In field: sfdx force:package:version:create --package 'package-name' --path force-app --wait 50 -v 'devHubName' -f .\config\project-scratch-def.json

ERROR running force:package:version:create: CHR Gardes: In field: PicassoSite - no SiteDotCom named CHR_Gardes1 found, CHR_Gardes1: In field: Network - no Network named CHR Gardes found

I already checked this answer and made sure to avoid namespaces, I didn't include siteDotCom in package.xml and I couldn't find any other hint to help me overcome my problem.

Content of project-scratch-def.json :

    {
  "orgName": "Demo company",
  "edition": "Developer",
  "features": ["Communities", "PublishAuraExpBuilderBasedSna", "PublishExpBuilderBasedSna", "EnableSetPasswordInApi"],
  "settings": {
    "lightningExperienceSettings": {
      "enableS1DesktopEnabled": true
    },
    "mobileSettings": {
      "enableS1EncryptedStoragePref2": false
    },
    "experienceBundleSettings": {
      "enableExperienceBundleMetadata": true
    },
    "communitiesSettings": {
      "enableNetworksEnabled": true
    }
  }
}

Content of package.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>CHR_Gardes</members>
        <name>CustomSite</name>
    </types>
    <types>
        <members>CHR_Gardes1</members>
        <name>ExperienceBundle</name>
    </types>
    <types>
        <members>CHR Gardes</members>
        <name>Network</name>
    </types>
    <types>
        <members>Customer Community Plus Login User - Garde</members>
        <name>Profile</name>
    </types>
    <version>53.0</version>
</Package>

Any clue on what's causing the issue would be much appreciated. Thank you.

Edit #1: Content of sfdx-project.json

    {
  "packageDirectories": [
    {
      "path": "force-app",
      "default": true,
      "package": "chr-community",
      "versionName": "ver 0.1",
      "versionNumber": "0.1.0.NEXT",
      "dependencies": [
        ...
      ]
    }
  ],
  "name": "CRG-CHR Community",
  "namespace": "",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "54.0",
  "packageAliases": {
    ...
  }
}

Edit #2 : Content of the folder structure enter image description here

6
  • package.xml is irrelevant. You simply need all the required metadata in the package directory in your sfdx-project.json and to create a package then create and promote versions of that package.
    – Phil W
    Apr 24, 2022 at 18:38
  • Please edit the question to provide detail of your sfdx-project.json and to show the package director's structure.
    – Phil W
    Apr 24, 2022 at 20:07
  • Thank you for your answer @PhilW, as per your request I updated the question to include the content of the sfdx-project.json but omitted the dependencies because it is a long list. I shared the content of package.xml to show what metadata I have in my force-app folder.
    – THEDJA
    Apr 24, 2022 at 22:13
  • What sort of dependencies do you have here and is this an unlocked package or org dependent unlocked package? Exactly what value is shown instead of XX in the message? I assume you are not actually using the package.xml anywhere and it is just created for this question? Showing the folder structure would be more appropriate.
    – Phil W
    Apr 25, 2022 at 6:12
  • I have dependencies on some NPSP packages and our own packages. I used package.xml to pull metadata from my dev org. I updated the question to show the folder structure.
    – THEDJA
    Apr 25, 2022 at 9:11

1 Answer 1

3

You appear to be missing the "sites" entry:

V sites
| o CHR_Gardes.site-meta.xml
1
  • Thank you for your help @PhilW, I don't know how I overlooked that.
    – THEDJA
    Apr 25, 2022 at 19:16

You must log in to answer this question.

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