Skip to content
Happy Programming Guide
Start learning
Coding Tools

VS Code “Error While Fetching Extensions” (XHR Failed)

The Extensions view shows an error instead of a list. It is a network problem between VS Code and the marketplace: proxy, certificate, DNS or a blocked domain. The checks, in order.

A small beetle photographed up close

“Error while fetching extensions. XHR failed” means VS Code asked the extension marketplace for a list and the request did not get through. VS Code itself is fine; something between it and the marketplace — a proxy, a corporate certificate, a firewall rule, a DNS problem — is in the way. The error text is unhelpful, but the causes are few and each has a quick test.

Step 1: what is the real error?#

Open Help, Toggle Developer Tools, then the Console tab, and reload the Extensions view. The XHR failure is logged with a cause: ECONNREFUSED, ENOTFOUND, CERT_HAS_EXPIRED, self signed certificate in certificate chain, 407 Proxy Authentication Required. Each points to a different section below.

Step 2: can the machine reach the marketplace?#

Terminal
curl -I https://marketplace.visualstudio.com
curl -I https://update.code.visualstudio.com
curl -I https://vscode.blob.core.windows.net

Run these from a terminal. If they fail too, the problem is the network, not VS Code, and the fix is on the network side: a firewall exception for those domains, plus *.gallerycdn.vsassets.io and *.vscode-unpkg.net, which serve extension packages. The official documentation lists the complete set.

If curl works and VS Code does not, VS Code is not using the same network settings as your shell — usually a proxy configured in one place and not the other.

Proxies#

VS Code reads proxy settings from, in order: its own http.proxy setting, then the HTTP_PROXY and HTTPS_PROXY environment variables, then the operating system’s proxy configuration. A mismatch between these is the most common cause on corporate machines.

JSON
{
  "http.proxy": "http://proxy.example.com:8080",
  "http.proxyAuthorization": null,
  "http.proxySupport": "on"
}

If the proxy needs a username and password, the URL form is http://user:[email protected]:8080. A 407 in the console means authentication is required and not being sent.

Launch VS Code from a terminal where the proxy variables are set, so it inherits them:

Terminal
export HTTPS_PROXY=http://proxy.example.com:8080
code .

Set "http.proxySupport": "off" to test whether the proxy is the problem at all; if extensions load without it, the proxy configuration is wrong.

Certificates#

Corporate networks often inspect HTTPS traffic by re-signing it with their own certificate. Browsers trust it because the organisation installed the root certificate; VS Code’s built-in network stack may not. The console error mentions a self-signed certificate or an unknown issuer.

The right fix is telling VS Code to use the system certificate store, which is the default in current versions:

JSON
{ "http.systemCertificates": true }

If that is already on and the error persists, the root certificate is not installed at the OS level; get it from whoever runs the network and install it in the system store. As a last resort for diagnosis only:

JSON
{ "http.proxyStrictSSL": false }

That disables certificate checking for VS Code’s requests. If it makes the Extensions view work, you have confirmed a certificate problem; turn it back on once the real certificate is installed.

DNS and VPN#

ENOTFOUND means the marketplace hostname did not resolve. Check whether a VPN is up and whether it routes all traffic through a network that blocks the domains; try with the VPN off. Some security software replaces DNS and blocks CDN hosts by policy.

Other causes#

  • A stale cache. Quit VS Code and delete the CachedExtensionVSIXs folder under the user data directory (%APPDATA%\Code on Windows, ~/.config/Code on Linux, ~/Library/Application Support/Code on macOS).
  • An old VS Code. Marketplace API changes occasionally break very old versions. Update.
  • A fork. VSCodium and similar use the Open VSX registry rather than Microsoft’s marketplace; a product.json pointing at the wrong one produces this error.
  • Time and date wrong. A clock far off makes every certificate invalid.

Installing from a file#

When the network cannot be fixed today, download the extension’s .vsix file from the marketplace website on a machine that can reach it, then install it:

Terminal
code --install-extension ms-python.python-2026.1.0.vsix

Or in the Extensions view, the … menu has Install from VSIX. Dependencies are not resolved automatically this way; install each extension pack member separately.

Questions people ask#

Extensions load but installation fails.

Listing and downloading use different domains. Add the CDN hosts, *.gallerycdn.vsassets.io and *.vscode-unpkg.net, to whatever allowlist the marketplace domain is on.

It worked yesterday.

A VPN, a network change, an expired certificate, or a proxy password that changed. The console error tells you which.

Does this affect Settings Sync and updates too?

Often, since they use related domains. Fixing the proxy or certificate fixes all of them at once.

Can I use VS Code fully offline?

Yes, with extensions installed from VSIX files. Everything except the marketplace, updates and sync works without a network.

Where to go next#

VS Code extensions not working or not showing in the sidebarRead next

Keep reading

Keep going — pick your next guide

The fastest way to improve is to read one guide, then build the thing it describes. Start with the basics, or jump straight to a project.

Ask a question or share what worked

Your email address will not be published. Required fields are marked *