0

I have newly created a project then created a random LWC page and right click on it and deploy and it is giving me below error

The file or directory that you tried to deploy or retrieve isn't in a package directory that's specified in your sfdx-project.json file. Add this location to your "packageDirectories" value, or deploy or retrieve a different file or directory. For details about sfdx-project.json, see: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_config.htm You can run SFDX: Deploy Source to Org only on a source file or directory.

Below is my sfdx-project.json

{
  "packageDirectories": [
    {
      "path": "force-app",
      "default": true
    }
  ],
  "name": "myproject",
  "namespace": "",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "55.0"
}

enter image description here

13
  • can you add your folder structure as well?
    – Ysr Shk
    Jul 8 at 12:34
  • I have added the screenshot, it is a newly created project no change from side at all related to file system.
    – gs650x
    Jul 8 at 12:46
  • The error you recd mostly it occurs when you mention something in manifest>package.xml and it's not present in the folder structure. Pls check that file once. Also check if LWC folder has something which is supposed to get deployed.
    – Ysr Shk
    Jul 8 at 12:50
  • 2
    This is reported by several users.See github.com/forcedotcom/salesforcedx-vscode/issues/4261. Try downgrading the "Salesforce CLI Integration" extension version.
    – Swetha
    Jul 8 at 14:01
  • 1
    you are awesome! thank you so much, this solved my issue.
    – gs650x
    Jul 8 at 14:30

1 Answer 1

2

The issue you are seeing is related to the recently published version v55.4.0 of the Salesforce Extension for VS Code.

Multiple users are impacted by this.You can follow https://github.com/forcedotcom/salesforcedx-vscode/issues/4261 for updates.

The workaround for now, would be to downgrade the "Salesforce CLI Integration" extension version.

I will keep this thread updated as I have more inputs from our concerned Salesforce product development team.

Update: As a fix, v55.4.1 of the Salesforce Extension for VS Code has been published. See the release notes here: https://github.com/forcedotcom/salesforcedx-vscode/releases/tag/v55.4.1

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.