deploymentsalesforceapexlwcsfdx

Error Deploying or Retrieving source: The file or directory isn't in sfdx-project.json


All of a sudden I started getting this error everytime I'm trying to deploy or retrieve a file directly (right click on apex file and retrieve). This always worked and now it doesn't for all of my projects. I tried opening new ones, etc. Error deploying or retrieving source: 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


Solution

  • 🚨 The extension has been fixed as of today. 🚨

    If you're still getting the error navigate to the Extensions button and click reload on one of the Salesforce extensions:

    See this image for instructions on reloading VS Code Extensions