When deploying metadata containing an ExperienceBundle and a component (for instance, with sfdx metadata deploy commands to prod, or when pushing to a new (empty) scratch org), we are frequently (but not always) getting an error:
Error force-app/main/default/experiences/Events2.site-meta.xml Specify "lightningCommunity__Page" as the target for the Lightning web component c:footer in Events2/views/host.json and try again.
Deploying c:footer
alone, followed by the full deployment (containing the same LWC, no changes), usually resolves the issue. What is odd, is this issue occurs even when neither metadata changes.
Something that has never been an issue, but is odd - we have an Events site and an Events community, so instead of the ExperienceBundle being called Events1, it is Events2 instead. No issues have come up from this... so far.
The footer metadata is like this (will try updating the API version now that I see it):
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>47.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightningCommunity__Page</target>
<target>lightningCommunity__Default</target>
</targets>
<targetConfigs>
<targetConfig targets="lightningCommunity__Default">
<!-- omitted -->
</targetConfig>
</targetConfigs>
</LightningComponentBundle>
And, usage in the ExperienceBundle host.json
JSON looks like:
"components" : [ {
"componentAttributes" : {
/* all of the properties are correct and match the ones in the js-meta */
},
"componentName" : "c:footer",
"id" : "<uuid omitted>",
"renderPriority" : "NEUTRAL",
"renditionMap" : { },
"type" : "component"
} ],