Skip to main content

This is a new problem I am having with VS Code. I created an SFDX project as normal and I get this error:

 

'Starting SFDX: Refresh SObject Definitions

 

13:27:26.524 sfdx sobject definitions refresh Unable to process sObjects when not in an SFDX project c:\Users\keith\Documents\Trailhead\VSCodeQuickstart\.sfdx

13:27:26.527 sfdx sobject definitions refresh  ended with error Unable to process sObjects when not in an SFDX project c:\Users\keith\Documents\Trailhead\VSCodeQuickstart\.sfdx

 

13:27:26.527 sfdx sobject definitions refresh

 ended with exit code 1'

 

This is very odd since as far as I know this IS a SFDX project and from what I can see it is causing a bunch of errors because there are no standard sObjects defined in it. I am told for similar problems in various posts to run  'SFDX: Refresh SObject Definitions' from the command palette but I can't find it!

 

I have reinstalled and refreshed everything - VS Code, CLI and Extensions - nothing works. Does anyone have any idea what is going on here?

8 件の回答
  1. 2024年4月28日 9:46

    I found (at least part of) the answer in this page: 

     

    https://developer.salesforce.com/docs/atlas.en-us.248.0.sfdx_setup.meta/sfdx_setup/sfdx_setup_move_to_sf_v2.htm

     

    If you haven't done so already, update CLI from sfdx (v7) to sf (v2), then run the following command in a command prompt window: 

    sf autocomplete --refresh-cache

     

    If Visual Studio Code is open, close and reopen. Your project should now behave normally. I have had however to do this for two new projects so there is probably a script that needs updating. I'll continue to work this through.

    sf autocomplete --refresh-cache
0/9000