1

I am trying to set a default org in VScode but it is not working. I get a Cannot read property 'getInstance' of undefined error.

ERROR running force:auth:web:login: Cannot read property 'getInstance' of undefined

Command : sfdx force:auth:web:login --setalias test --instanceurl https://test.salesforce.com --setdefaultusername

Output : ERROR running force:auth:web:login: Cannot read property 'getInstance' of undefined

Can anyone please help with this.

1

Usually this kind of issues are due to sfdx updates by salesforce, first step would be to updating SFDX with sfdx update command.

If that doesn't work, try to uninstall the salesforcedx Plug-In with below command and install it again.

sfdx plugins:uninstall salesforcedx

Edit: There is an issue on Salesforce CLI github project which mentions this.

3
  • 1
    This is basically a link-only answer, which may get this answer flagged for deletion. You should at least include the critical details in the answer. – sfdcfox Aug 24 '20 at 13:47
  • I was being lazy and have updated the answer, thanks for the heads-up @sfdcfox – Raul Aug 24 '20 at 18:13
  • @Raul Thanks, SFDX update didnt work but uninstall and reinstalling did the trick – Bob Gali Aug 25 '20 at 0:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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