2

I have recently installed Visual Studio Code and trying to install python extension from marketplace but it is throwing an error "Error while fetching extensions : XHR failed". I am using Windows 10 and behind a corporate firewall. The issue seems to be certificate related. I have tried various proxy settings changes. For eg : mentioned here : https://www.mikearthur.net/visual-studio-code-error-while-fetching-extensions-xhr-failed

I also tried to use Px for Windows but none of it resolved my issue. Can someone please help ?

SAK
  • 49
  • 1
  • 2
  • 6
  • Have you check the “Output" panel message? – rustyhu Feb 14 '22 at 15:29
  • Does this answer your question? [Visual Studio Code "Error while fetching extensions. XHR failed"](https://stackoverflow.com/questions/70177216/visual-studio-code-error-while-fetching-extensions-xhr-failed) – Steve Chambers Jun 22 '22 at 11:20
  • Does this answer your question? [Error while fetching extension. XHR failed](https://stackoverflow.com/questions/72781369/error-while-fetching-extension-xhr-failed) – starball Jul 10 '23 at 17:55

5 Answers5

3

I also have sometimes to work behind a corporate firewall, and the following worked for me with VS Code 1.66.1 :

  • Try downloading the extension from VS Code. For me, this fails and triggers a notification "Error while installing '...' extension" with a button "Try Downloading Manually".
  • Click on "Try Downloading Manually" (or download the extension directly from the VS Code marketplace website). This will download a .vsix file.
  • In my case, if I go directly into VS Code extension panel and try to "Install from VSIX...", it will fail with the message "Corrupt ZIP: end of central directory record signature not found". However, if I switch first to offline (by disconnecting from wifi or LAN), the installation will work properly... it seems VS Code can handle the situation where you're forced to work completely offline, but it's not designed to handle specific proxy/firewall.
user18048269
  • 125
  • 8
0

I faced the same problem. I'm using a network provided by XFinity and the DNS is automatically set to comcast DNS.

I changed the DNS server to be 8.8.8.8 and solved it.

Kris
  • 1
0

Same problem, and Help-Toggle Developer Tools-Console show: net::ERR_CONNECTION_RESET.

Tried reboot,reinstall,reset network,change DNS,change proxy,etc,didn't work.

I fixed this by reinstall System Installer version from: https://code.visualstudio.com/#alt-downloads, it seems a network/file permission problem I guess.

Hugo
  • 1
  • 1
0

I fixed the problem of "XHR errors" within my settings, which is to remove HTTP-proxy environment variables from the system (Windows). I restarted VSCode, and the problem disappeared.

Jacky
  • 1
-1

Disable proxy settings on your system.

Timothy G.
  • 6,335
  • 7
  • 30
  • 46
Mark
  • 1
  • 1