How to Fix “Error While Turning on Settings Sync. No Account Available” in Visual Studio Code


How to Fix “Error While Turning on Settings Sync. No Account Available” in Visual Studio Code

If you’re experiencing difficulties connecting your GitHub account to Visual Studio Code (VS Code) to enable settings sync and consistently seeing the error message “Error while turning on settings sync. No account available,” here’s a step-by-step guide to troubleshoot and fix the issue.

Step 1: Check Built-in Extensions

One of the common reasons for this error is related to the built-in authentication extensions in VS Code. To resolve this, follow these steps:

  1. Open Extensions View
  • In VS Code, press Ctrl + Shift + X (or Cmd + Shift + X on Mac) to open the Extensions View.
  1. Search for Built-in Extensions
  • In the search bar at the top, type the following commands one at a time:
    @builtin microsoft-authentication
    @builtin github-authentication
  1. Verify Extensions’ Status
  • Ensure that both microsoft-authentication and github-authentication extensions are enabled. If either of these extensions is disabled, click on the “Enable” button to activate them.

Step 2: Restart Visual Studio Code

After ensuring the extensions are enabled, restart Visual Studio Code. This helps apply the changes and re-initializes the authentication process.

Step 3: Reconnect Your GitHub Account

Once VS Code has restarted:

  • Go to File > Preferences > Settings Sync.
  • Click on Turn on Settings Sync and follow the prompts to connect your GitHub account.

Additional Tip: Disable and Re-enable Extensions

If the issue persists:

  • Try disabling the microsoft-authentication and github-authentication extensions.
  • Restart VS Code.
  • Re-enable the extensions and attempt the connection again.

This should resolve the issue and allow you to connect your GitHub account seamlessly.