Error deploying or retrieving source

salesforcedxvs-code

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

Best Answer

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

Related Topic