I had the same problem, I did the following steps to solve it

All you need to do is enter to the JSON settings file from VSC

  1. Press F1
  2. Type User Settings
  3. Search for Proxy
  4. In proxy section, look for the title Http: Proxy Authorization
  5. Click on 'Edit in settings.json'
  6. Delete all brackets containing proxy data
  7. Save JSON file

After that, just restart VSC You can also find the JSON in %appdata%/Code/User/settings.json

Answer from Binjie Liang on Stack Overflow
🌐
GitHub
github.com › microsoft › vscode › issues › 211314
XHR Failed when fetching extension. Fixed after changing Http Proxy setting. · Issue #211314 · microsoft/vscode
April 25, 2024 - Search in extension shows XHR failed. Change proxy to some dummy. Search again, same result. Change proxy back to empty. Search again. Everything works! Close vscode and reopen. Search again.
Author   fatboyzz
Discussions

I am unable to install any extensions or code spaces on visual studio
Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned. 2023-12-25 18:24:28.642 [info] Started local extension host with pid 12688. 2023-12-25 18:24:31.323 [info] [perf] Render performance baseline is 82ms When I go to extensions, and try to install python, an error message pops up: Error while installing 'Python' extension. Please check the [log](command:workbench.action.showWindowLog) for more details. The log shows: 2023-12-25 18:26:50.925 [error] Error: XHR failed ... More on learn.microsoft.com
🌐 learn.microsoft.com
1
0
December 25, 2023
error while fetching extensions XHR failed
I don't install extensions, because always "error while fetching extensions XHR failed". More on github.com
🌐 github.com
11
January 22, 2024
VS Code XHR failed
Does this issue occur when all extensions are disabled?: Yes/No VS Code Version: 1.74.1 OS Version: Windows 10 Steps to Reproduce: Install python extension (or other extensions) [error] XHR failed,... More on github.com
🌐 github.com
14
January 9, 2023
XHR Failed on trying to install plugins via Visual Studio code
VSCode Version: 1.16.0 OS Version: Windows 10 Steps to Reproduce: When trying to install a plugin, i get an error XHR Failed. Also when i try to download the extensions manually and try to install ... More on github.com
🌐 github.com
215
September 14, 2017
🌐
Reddit
reddit.com › r/vscode › [help] i had vscode for almost a year and never faced this problem. xhr error makes me unable to download any extension.
r/vscode on Reddit: [Help] I had vscode for almost a year and never faced this problem. XHR error makes me unable to download ANY extension.
May 27, 2024 - its my personal network. I have tried override, fallback, off, on and nothing pretty much works. I guess the option is to download it from VSIX as the above comment said or just reinstalling vscode
🌐
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 1467988 › i-am-unable-to-install-any-extensions-or-code-spac
I am unable to install any extensions or code spaces on visual studio - Microsoft Q&A
December 25, 2023 - Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned. 2023-12-25 18:24:28.642 [info] Started local extension host with pid 12688. 2023-12-25 18:24:31.323 [info] [perf] Render performance baseline is 82ms When I go to extensions, and try to install python, an error message pops up: Error while installing 'Python' extension. Please check the [log](command:workbench.action.showWindowLog) for more details. The log shows: 2023-12-25 18:26:50.925 [error] Error: XHR failed at k.onerror (vscode-file://vscode-app/c:/Users/mtzbi/AppData/Local/Programs/Microsoft VS Code/resource
🌐
GitHub
github.com › microsoft › vscode › issues › 202993
error while fetching extensions XHR failed · Issue #202993 · microsoft/vscode
January 22, 2024 - I don't install extensions, because always "error while fetching extensions XHR failed".
Author   FahmiMaulana98
🌐
GitHub
github.com › microsoft › vscode › issues › 170818
VS Code XHR failed · Issue #170818 · microsoft/vscode
January 9, 2023 - Does this issue occur when all extensions are disabled?: Yes/No VS Code Version: 1.74.1 OS Version: Windows 10 Steps to Reproduce: Install python extension (or other extensions) [error] XHR failed,...
Author   Hussainsmg
🌐
Bobby Hadz
bobbyhadz.com › blog › error-while-fetching-extensions-xhr-failed
Fix Error while fetching extensions. XHR failed in VS Code | bobbyhadz
April 6, 2024 - The VS Code "Error while extensions. XHR failed" error occurs when you have internet connectivity, proxy or firewall issues.
Find elsewhere
🌐
YouTube
youtube.com › watch
How to fix "Error While Fetching Extensions. XHR Failed" error in VSCode [FIXED] - YouTube
In this video, I'll show you how to fix the error: "Error While Fetching Extensions. XHR Failed" in visual studio code. This error usually occurs due to prox...
Published   November 30, 2023
🌐
GitHub
github.com › microsoft › vscode › issues › 34385
XHR Failed on trying to install plugins via Visual Studio code · Issue #34385 · microsoft/vscode
September 14, 2017 - VSCode Version: 1.16.0 OS Version: Windows 10 Steps to Reproduce: When trying to install a plugin, i get an error XHR Failed. Also when i try to download the extensions manually and try to install it via the options "install from VSIX", ...
Author   vinothbabu
🌐
GitHub
github.com › microsoft › vscode › issues › 162137
Error while fetching extensions. XHR failed · Issue #162137 · microsoft/vscode
September 27, 2022 - DevTools failed to load source map: Could not load content for https://ticino.blob.core.windows.net/sourcemaps/74b1f979648cc44d385a2286793c226e611f59e7/node_modules/vscode-textmate/release/main.js.map: Load canceled due to load timeout · ERR RequestService#request (browser) - error https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery Error: XHR timeout: undefinedms at v.ontimeout (workbench.desktop.main.js:70:8904)
Author   Raideryu
🌐
YouTube
youtube.com › watch
Error while fetching extensions. XHR failed | how to download pluggings to vs code - YouTube
error while fetching extensions. xhr failed how to download pluggings to vs code error while fetching extensions. xhr failed, vscode, c# vsix cli, programmi...
Published   January 11, 2022
🌐
GitHub
github.com › microsoft › vscode › issues › 112085
XHR failed · Issue #112085 · microsoft/vscode
December 8, 2020 - it shows this error whenever is try to download an extension
🌐
Microsoft Answers
answers.microsoft.com › en-us › windows › forum › all › i-am-unable-to-install-any-extensions-or-code › 042ab092-d427-4880-91a7-478f8c98ca3b
I am unable to install any extensions or code spaces on visual studio. - Microsoft Q&A
December 25, 2023 - Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned. 2023-12-25 18:24:28.642 [info] Started local extension host with pid 12688.2023-12-25 18:24:31.323 [info] [perf] Render performance baseline is 82ms · When I go to extensions, and try to install python, an error message pops up: Error while installing 'Python' extension. Please check the log for more details. ... 2023-12-25 18:26:50.925 [error] Error: XHR failed at k.onerror (vscode-file://vscode-app/c:/Users/mtzbi/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:95
🌐
GitHub
github.com › microsoft › vscode › issues › 222125
XHR failed when fetching extensions. · Issue #222125 · microsoft/vscode
July 19, 2024 - Does this issue occur when all extensions are disabled?: Yes VS Code Version: 1.91.1 f1e16e1 x64 OS Version: Description: Ubuntu 24.04 LTS Release: 24.04 Codename: noble Steps to Reproduce: Open VS Code Select extensions When fetching po...
Top answer
1 of 3
3

I found the solution for my problems. it solved by using vpn. the problem was my wifi provider probably blocking the request on vs code, seems like there's something fishy about the DNS policy.

2 of 3
2
  1. Your problem is the same as discussed in this thread:

    • Visual Studio Code "Error while fetching extensions. XHR failed"
  2. Unfortunately, there are several DIFFERENT possible root causes, and several different workarounds and solutions discussed in the thread.

  3. You said you "tried several things". Please Update your post and specify exactly WHAT you tried, and the results.

  4. You said it "works" on certain networks, but fails on your (home? school? other?) network (whether or not the network is "wifi" or not probably doesn't matter). Please clarify exactly "what's different" between the networks (to the best of your knowledge).

  5. Please specify the platform you're running VSCode on (windows? MacOS? Linux? Other?)

  6. Try this (one of the responses in the SO thread I cited above):

https://stackoverflow.com/a/71456820/421195

  1. press f1
  2. search "user setting"
  3. click enter
  4. search on user setting "proxy"
  5. click enter
  6. look for "use the proxy support for extensions."
  7. change "override" to on

Q1: You're running the same version of VS Code, on Windows, using the same project, at home and at school, correct?

<= Q: Are you using the same PC (e.g. carrying a laptop from home to school), or are you using different PCs at home and at school?

Q2. By "Mobile data" (vs. "wifi"); you mean you "hotspot" for your cell phone service, correct?

Q3. The project ALWAYS works for Wifi (either at home or school), but NEVER works for your Hotspot, correct?

Q4. You're always trying to run the Remote Explorer extension in VS code when the error occurs (it never happens with other VSCode activities), correct?

<= Q: Any problems in other areas of VSCode (e.g. your compiler)?

Q5. The exact error message is The editor could not be opened due to an unexpected error: XHR failed, correct?

<= Q: Always using Remote Explorer, correct? What exactly are you doing in Remote Explorer?

BE SURE TO TRY ALL THE TROUBLESHOOTING TIPS HERE

(including verifying "ssh" from the VSCode command line, using your "bad" network):

https://code.visualstudio.com/docs/remote/ssh

🌐
The Windows Club
thewindowsclub.com › the windows club › general › unable to install extensions in visual studio code
Unable to install extensions in Visual Studio Code
July 8, 2023 - Does Visual Studio Code fail to fetch the demanded extensions? When we search for the extension from the Marketplace, it sometimes throws an error, whereas, on some occasions, it keeps on loading the extension screen. In this post, we will see what to do if you cannot install extensions in Visual Studio Code. Error while fetching extensions. XHR failed.
🌐
Blogger
itgeeknotes.blogspot.com › 2020 › 09 › visual-studio-code-error-xhr-failed-in.html
IT Geek Notes: Visual Studio Code - error "XHR failed" in extensions
September 11, 2020 - So, if you are faced with "XHR failed" issue, check network requirements, hosts file and firewall rules.