Error deploying or retrieving source

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"
}

Error deploying or retrieving source

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

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


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x