I'm using VScode for Apex dev. I have logged into Devhub org. and created a scratch org. when I try to execute pallet command:

SFDX: Refresh SObject Definitions

I'm getting below error.

enter image description here

No sfdx-project.json found in the root directory of your open project. Open a Salesforce DX project in VS Code.

Either I may be doing something silly/wrong, but I see the sfdx-project.json file in current folder which is root folder of project I believe. enter image description here

Any clue/workaround for this error? appreciate any help. Thanks.

  • Tried updating sfdx? I think syntax is 'sfdx update' off the top of my head. Your comment below about command missing sounds like Salesforce extensions error bubbling through vs code, rather than vs code itself. Other than that, reinstall Salesforce extensions.
    – frackham
    Commented Dec 13, 2018 at 7:56
  • Also, what does sfdx force:org:list show against your Dev hub?
    – frackham
    Commented Dec 13, 2018 at 7:56
  • @frackham for some reason, those commands are working, but pallet's clickable commands were not working. Commented Dec 14, 2018 at 2:57

2 Answers 2


You're missing a configuration file for some reason. Try the following.

Close all files and folders in Visual Studio Code, then close it entirely.

Create a new folder in your project directory called .vscode. Windows Explorer won't let you do this, so do it from a terminal:

mkdir ".vscode"

Go in to this folder and create a new file called settings.json. The contents of this file should be as follows:

    "terminal.integrated.env.osx": {
        "SFDX_SET_CLIENT_IDS": "sfdx-vscode"
    "terminal.integrated.env.linux": {
        "SFDX_SET_CLIENT_IDS": "sfdx-vscode"
    "terminal.integrated.env.windows": {
        "SFDX_SET_CLIENT_IDS": "sfdx-vscode"

Afterwards, reopen the entire folder, and everything should start working.

If this doesn't work for some reason, you will probably need to create a new project entirely. Create a new project with "SFDX: Create New Project" and follow the prompts. The newly created project should have the Visual Studio Code configuration files you need. Afterwards, you may need to authorize your orgs again, or you can try copying the .sfdx folder from the old project folder.

  • Thank you @sfdcfox, I used to create project from typing command., apparently when I tried selecting the create project it didn't work either, threw command missing error. followed: 1. Open Run (Win + R), located %appdata%. 2. Deleted the folder Code., reopened vscode and tried Command pallet commands. They started working. still unfortunately SObject definitions are not appearing when I press ctrl+space. Commented Nov 29, 2018 at 5:37
  • @PasanE I don't even know if auto-complete works. At least, I've never seen it work. Might be a setting I'm missing. But at least if you can get past the error, it sounds like you're up and running.
    – sfdcfox
    Commented Nov 29, 2018 at 6:00
  • It seems to be working as they demo here Commented Nov 30, 2018 at 0:40
  • Hi @sfdcfox your solution worked for me for the exactly same problem of the OP. I was following along a trailhead and cloned a project into my local dir as stated, but what was missing was the .vscode folder, which I then manually copied from ANOTHER project (also created while doing trailhead, that actually used the SFDX: Create Project command instead of cloning from git). So seems issue is, the trailhead git project should include the .vscode folder in it. Commented Jul 23, 2019 at 10:38

In case anyone got this error when following the trailhead tutorial "Get Ready to Develop" as below, here's my find.

  1. Open Visual Studio Code on your computer.
  2. Open the Command Palette by pressing Ctrl+Shift+P (Windows) or Cmd+Shift+P (macOS/Linux).
  3. Type SFDX.
  4. Select SFDX: Create Project.

When carrying out step 1, you should just open a new window of VS code without choosing any folder to open. You will be asked about folder to create in this step afterwards:

  1. Select a folder on your device to store the project.

You must log in to answer this question.

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