Suddenly vscode stopped working with deploying the class to the sandbox I'm using and throws this message "No org configuration found for name INSTANCE NAME"

I tried to create a new project for the sandbox but still get the same error when I'm trying to retrieve all the classes from the org.

sfdx update didn't help.

  • 2
    It sounds like you need to authenticate again? Try sfdx force:auth:web:login -a "some-alias" -r https://test.salesforce.com/ -s (change some-alias to whatever you'd like to call the sandbox). – sfdcfox Mar 31 '19 at 12:45
  • Sometimes it might be a proxy issue. – sanket kumar Mar 31 '19 at 17:15

It may be a problem with aliases.

I have mistakenly created an alias: DevHub=me@salesforce.com

Then, not aware of consequences I created an alias again, in the way I wanted it in the first place: me@salesforce.com=DevHub

So I ended up having two aliases, which were translated by the CLI:

DevHub -> me@salesforce.com -> DevHub

So CLI was trying to use DevHub as my username, instead of me@salesforce.com

Hence, the error: No org configuration found for name DevHub

Verify Your aliases with:

sfdx force:alias:list

and delete unnecessary aliases (if any) by setting them as empty:

sfdx force:alias:set DevHub=
  • THIS IS THE BEST ANSWER AND SHOULD BE SELECTED AS ONE IN THIS PAGE. IMG moderators should be more strict on letting people selecting their own answer as the best answer even though they're not. This page's selected answer doesn't even provide any explanation. – Bahman.A Mar 9 at 22:51
  • @Bahman.A Moderators have no control over answer acceptance. It's completely at the discretion of the asker. – David Reed Mar 9 at 23:45

Deleting folders "tools", "typings" and the file "sfdx-config.json" and then close and open vscode solved the problem.

  • 4
    I tried this, then re-authorize and organization using command SFDX: Authorize an Org. It is working. But why? Care to do some explanation? Or it is just a caching issue? – ksugiarto Apr 25 '19 at 11:38
  • It also worked for me.. Anyone knows what is the cause of this? – Matej J Jan 14 at 10:44

I had the same problem just now, working with a developer sandbox and indeed authenticating again solved the issue. Thank you

  • authenticating again did not help. – osos9 Apr 2 '19 at 14:03

One of the reasons may be conflict in your aliases files. You can find following folder on your computer: %USERPROFILE%/.sfdx and find there file alias.json. There would be all your used aliases and you can investigate if you have any conflicts.


FYI, this happened to me. Specific error I got was: "No org configuration found for name DevHub"

I used the command: sfdx force:config:list to see my configuration values for defaultdevhubusername and defaultusername. I noticed that defaultdevhubusername was just DevHub so I changed this to the username I used to login to my DevHub and it worked. To change, I used command sfdx force:config:set defaultdevhubusername=myusername@domain.com

Hope this helps someone else.


I ran into this problem this week and this is how I solved it:

  1. open the .sfdx folder and manually delete the org configuration file

  2. remove the alias reference in the alias.json file

  3. re-auth into the org in a new terminal window

Not the answer you're looking for? Browse other questions tagged or ask your own question.