1

I'm new to Salesforce and am stuck on amending the price filter in the DreamHouse trailhead project.

The label for the price filter needs to be updated and deployed, but when I try to deploy the change the below error message keeps popping up in Visual Studio:

PS C:\Users\Carol\Desktop\VS Code\HelloWorldLightningWebComponent> sfdx force:source:deploy -m LightningComponentBundle:propertyFilter *** Deploying with SOAP API *** ERROR running force:source:deploy: No source backed components present in the package

I tried updating CLI, it is version: sfdx-cli/7.123.0 win32-x64 node-v14.18.1.

The exercise only asks to update the label to "Max to Spend". I tried updating value and onchange too, and removing spaces.

Also tried SFDX: Authorize an Org from the command prompt, in case there was an issue with Visual Studio connecting to the org.

Same error every time I try to deploy the change: ERROR running force:source:deploy: No source backed components present in the package.

Any ideas? Thank you for your help!

4 Answers 4

9

I had this issue, it was caused by my having the file type in my .forceignore

Worth adding to to your list of things to check.

2
  • You just saved me hours of headache Aug 17, 2022 at 16:20
  • This saved me, after many hours of re-installs of sfdx reauthing and more, incl npm etc. The worst thing about this is when your team mates add a file they found "too hard " to deploy to this txt file and you pull it down and next thing you cannot work out why your getting this random error. May 11 at 5:00
1

If I had to guess, I'd say you're either in the wrong directory, or you're missing one or more components you need.

First, make sure you're in the correct directory. You'll know you are because you'll see an sfdx-project.json file.

sfdx-project.json

If your Explorer doesn't look like this, verify that you're in the correct directory. In your command shell, try dir /s sfdx-project.json and use the correct directory:

sfdx-project.json for Dreamhouse

Switch to that directory and run Code from there.

Running VS Code on directory

After that, you can verify if your org is properly connected in the lower-left corner:

Connected Status

The plug icon should show your org's username or alias (here, sfdcfox). If this isn't right, click on the plug icon and choose the correct org (or you can authorize a new org).

Authorize an Org Dropdown

Now, this specific error suggests that your force-app directory is empty. Make sure your files are in the right place:

propertyFilter.html

If it doesn't look like this, there's a problem. Also, double-check your sfdx-project.json file, it should be exactly:

{
    "packageDirectories": [
        {
            "path": "force-app",
            "default": true,
            "package": "DreamhouseLWC",
            "versionName": "Summer '21",
            "versionNumber": "53.0.0.NEXT"
        }
    ],
    "namespace": "",
    "sourceApiVersion": "53.0",
    "packageAliases": {
        "DreamhouseLWC": "0Ho3h000000PBghCAG",
        "DreamhouseLWC@50.0.0-1": "04t3h000004skyPAAQ",
        "DreamhouseLWC@50.0.0-6": "04t3h000004slZvAAI",
        "DreamhouseLWC@50.0.0-8": "04t3h000004sla5AAA",
        "DreamhouseLWC@50.0.0-11": "04t3h000004slorAAA",
        "DreamhouseLWC@50.0.0-16": "04t3h000004sm0nAAA",
        "DreamhouseLWC@50.0.0-22": "04t3h000004sm5nAAA",
        "DreamhouseLWC@50.0.0-26": "04t3h000004sm67AAA",
        "DreamhouseLWC@50.0.0-28": "04t3h000004smaYAAQ",
        "DreamhouseLWC@51.0.0-1": "04t3h000004smn8AAA",
        "DreamhouseLWC@53.0.0-1": "04t3h000004VW48AAG",
        "DreamhouseLWC@53.0.0-3": "04t3h0000043sQIAAY",
        "DreamhouseLWC@53.0.0-5": "04t3h0000043scGAAQ"
    }
}

If it doesn't, try pulling down the repository to get the latest changes (note to future visitors: if this changes, feel free to modify this answer or let me know).


In summary, make sure you're connected to the right org, make sure you're in the right directory, make sure no files are missing, etc. I did verify that this is working (the modified file deployed successfully), so it is likely something you've done incorrectly. Try cloning a fresh copy of the git repository and try again, paying close attention to which directory the files are cloned in to.

2
  • Thank you! I started again, re-installing the package, creating a new org etc. I used your answer to double check I was on the right track, and it worked!
    – CMoney
    Oct 26, 2021 at 0:50
  • I am able to do succesful retrieves and deploys. but when I deploy documents I get "Document was named in package.xml, but was not found in zipped directory" So I succesfully tried a retrieve of a new document and then immediately tried a deploy of the same package with just that document and I go t the OPs above error: "No source-backed components present in the package." Aug 24, 2022 at 12:21
0

Probably you're trying to deploy an empty or nonexistent manifest file (package.xml). This is likely the error when you deploy 0 objects. I am getting the same error in my pipeline when I just to destructive changes but invoke both deploy for adding objects and :deploy for destructive in 1 go.

1
  • Just so you know, @CMoney placed a comment under sfdcfox answer saying it solved their problem. Cmoney didn't accept the answer though, but seeing your new answer perhaps they now will.
    – Kasper
    Jan 30, 2022 at 12:01
0

Check your component's API name because VSCode is case-sensitive. What's weird is retrieving the components is not case-sensitive but when deploying it is.

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Apr 3 at 5:51

You must log in to answer this question.

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