Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
When clicking the "Change Default Org" button in the VS Code status bar, rather than seeing a list of the orgs I was authorised against, I was seeing an error:
Unexpected end of JSON input
When checking the JSON files for the authorised orgs (on MacOS, this is in the ~/.sfdx directory), I noticed one of them was zero bytes. When that was deleted, everything was back working as normal.
I was able to resolve this issue in the sf folder, finding the maxRevision.json file and deleting it.
I then attempted to deploy again and it solved my issue, as well as created a new maxRevision.json folder as welll.