Fix: Error While Fetching Extensions XHR Failed (2024)

Are you getting the “Error while fetching extensions XHR failed” error while searching for the extensions in Visual Studio Code? If your answer is YES then you are in the right place.

Visual Studio Code is a free coding editor that helps you start coding quickly. This allows users to code in any coding language without switching editors.

Visual Studio Code has support for many languages, including Python, Java, C++, JavaScript, and more.

However, Visual Studio Code allows users to install extensions to automate different tasks.

Unfortunately, some users are encountering the error while trying to search and install any extensions on Visual Studio Codes.

That full error message reads, “Error while fetching extensions. XHR failed”.

If you are also getting the same error message, don’t worry.

In this guide, we will show you how to fix the “Error while fetching extensions XHR failed” error.

So without any further ado let’s get started:

How to Fix the “Error while fetching extensions XHR failed” Error

If you are getting the “Error while fetching extensions XHR failed” error then you can fix it using the steps below.

Change the Proxy Settings

While searching this topic on the internet, we have found that users are encountering this error because of the incorrect proxy settings.

So, to fix this error the first thing you can do is change the proxy settings.

Here is how you can do so:

  • On the Visual Studio Codes, click on the Gear Icon from the left to open up Settings.
Error While Fetching Extensions XHR Failed
image source: YouTube
  • Under settings, click on the Applications and select Proxy.
Error While Fetching Extensions XHR Failed
image source: YouTube
  • Here scroll down and find the Proxy Support.
  • Under proxy support try selecting different options from the drop-down menu.
Error While Fetching Extensions XHR Failed
image source: YouTube
  • After changing the proxy setting, search for the extension to check if your problem is fixed.
  • If you are still getting the same error, try another settings option.
  • You have to do this until you find the setting that resolves this error.
  • That’s it.

Flush DNS Cache

If changing the proxy settings does not fix your problem, you should consider flushing the DNS cache.

Use the following steps to flush the DNS cache:

  • Press the Windows + R keys together to open the Run Prompt.
  • Click on the text box, type CMD, and hit Enter.
  • This will open the Command Prompt.
  • Here run the following command:

    ipconfig /flushdns
Error While Fetching Extensions XHR Failed
  • This will clear all of the DNS cache and possibly resolve your problem as well.

Delete the Visual Studio Code

Sometimes users are getting errors like this because of the built-in cache files.

If you have tried changing the proxy settings and flushing the DNS cache but still facing the same error then you should consider deleting the Visual Studio Code cache files.

To do that open File Explorer and navigate to C drive > User > Current User > Link > AppData > Roaming > Code > Cache.

Under the cache folder select all files and folders and delete them.

Error While Fetching Extensions XHR Failed
image source: YouTube

Now restart the Visual Studio Code software and check if the error is fixed or not.

Reinstall Visual Studio Code

If you have tried everything but still getting the same error code, you should consider uninstalling and reinstalling the Visual Studio Code.

This will resolve all issues caused by missing files and incorrect installation.

That’s all you need to know about how to fix the “Error while fetching extensions XHR failed” error.

Leave a Comment