I was able to pull Custom Labels from a scratch org using sfdx force:source:pull, but when I tried pushing the labels to a fresh scratch org, or new labels to an existing scratch org, the push fails on any code that references the labels.

If I comment out the code that references the labels, I can push the source, but the labels are not added to the scratch org.

  • 1
    The Metadata Coverage Report is currently showing full support for Custom Labels in this scenario with the exception of one known issue. That isn't to say there isn't an unknown bug here. What does force:source:status show in relation to the custom labels? Oct 12, 2018 at 0:10

1 Answer 1


I found the problem: the <value> tag was missing from one of the Custom label definitions, which prevented the CustomLabels.labels-meta.xml file from loading. The error message was not helpful.

PROJECT PATH                                               ERROR
─────────────────────────────────────────────────────────  ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
N/A                                                        Main markup cannot be empty. If you are trying to delete the Lightning definition bundle, directly delete the bundle instead.
N/A                                                        Required field is missing: value (31:13)
force-app\main\default\aura\PostContent\PostContent.cmp    Label Share_Count cannot be found in namespace c.
N/A                                                        We couldn't validate your component. Review it and try again. The following code has invalid references which caused safe validation failure. AuraDefinition [
                                                           null] (0:0)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.