Recently, I upgraded the Salesforce CLI, sf, and ran into the following error:
Error (10): Metadata API request failed: Cannot read properties of null (reading ‘split’)
If you look closely at your Salesforce projects in VS Code or via your favorite OS Explorer, you will see that there are two hidden folders.
- .sf
- .sfdx
These folders contains metadata, tools, apex classes and data stores. Regardless of the OS or VS Code that you are running – the error or errors that result from an cli upgrade manifest themselves when trying to work with existing Salesforce projects.
I removed the .sf and .sfdx hidden folders from my project. Then, ran
sf config:set target-org=myorg
I was able to work with my project without encountering any additional errors.