Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

How can I avoid the ERROR running force:source:deploy: No source backed components present in the package?

Asked by Aalap Prabhakaran Aug 29, 2023 3.3K views 2 answers
Share

About this question

 I want to filter the price label to be updated and deployed. But when I am trying to deploy, I am getting the below error: no source backed components present in the package, which looks like the part provided below: 

I have also tried updating CLI, value and onchange too, and removing spaces.However, the error persists. Any suggestions will be helpful.

Your answer

2 Answers

Ranjana Admin JanBask Expert Latest answer

Answered on May 29, 2024

The error "ERROR running force:source:deploy: No source backed components present in the package" typically occurs when attempting to deploy metadata to a Salesforce org using the Salesforce CLI (sfdx) but the specified source files are not found or are not recognized as valid metadata components.

Here are some steps to troubleshoot and resolve this issue:

1. Verify Your Source Directory Structure

Ensure that your source files are in the correct directory structure as expected by Salesforce. The default structure should follow the force-app/main/default hierarchy. For example:

force-app/
└── main/
    └── default/
        ├── classes/
        │   ├── MyClass.cls
        │   └── MyClass.cls-meta.xml
        ├── objects/
        │   └── MyCustomObject__c/
        │       ├── MyCustomObject__c.object
        └── ...

2. Check the Manifest File (package.xml)

If you are using a package.xml file to specify which components to deploy, make sure it correctly references the components you want to deploy. Here is an example of a simple package.xml:



   

        *

        ApexClass

   

   

        *

        CustomObject

   

    55.0

3. Specify the Correct Source Path

Ensure you are specifying the correct path to your source files in the sfdx force:source:deploy command. For example, if your source files are in force-app/main/default, use:

sfdx force:source:deploy -p force-app/main/default

4. Include the Correct Metadata Types

If you are deploying specific metadata types, make sure they are included and correctly defined in your source directory or package.xml. For example, ensure that all necessary files (e.g., *.cls, *.object, *.trigger) are present and










Was this helpful?

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.