Reputation: 1087
This problem started a few weeks ago, when I started using NordVPN on my laptop. When I try to search for an extension and even when trying to download through the marketplace I get this error:
EDIT: Just noticed another thing that might indicate to what's causing the issue. When I open VSCode and go to developer tools I get this error messege (before even doing anything):
"(node:19368) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.(Use Code --trace-deprecation ...
to show where the warning was created)"
The only partial solution I found so far was to manually download and install extensions.
I've checked similar question here and in other places online, but I didn't find a way to fix this. So far I've tried:
I'm using a laptop running Windows 10. Any other possible solutions I haven't tried?
Upvotes: 94
Views: 458658
Reputation: 1960
In my case, just only sign in with Microsoft Account works for me according to Drew Kimani comment on this question. Please follow this steps:
After done, it will resolve this problem.
Upvotes: 3
Reputation: 43426
It's worth checking if Microsoft's service is online:
https://marketplace.visualstudio.com/
As I write this, it says "Azure DevOps Services Unavailable".
Sorry! Our services aren't available right now.
We're working to restore all services as quickly as possible. Please check back soon.
Upvotes: 2
Reputation: 1422
2024 Settings Specifics for XHR Error in VS Code
The following is relavent - but it is not a root cause. These settings may allow you to install one extension at a time but you have to restart VS Code to install each extension.
1 - Look at Your Settings
2 - Choose Settings From the Flyout
3 - Look at your Application - Proxy settings
The User Settings for your Application - Proxy within VS Code probably should be something different. Notice if your settings are "synced" acrosss devices -this may be relavent to your situation.
Upvotes: 1
Reputation: 932
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
Http: Proxy Authorization
After that, just restart VSC
You can also find the JSON in %appdata%/Code/User/settings.json
Upvotes: 81
Reputation: 41
I had the same problem. I had no proxy on the system and no proxy entries in the settings. VS Code could not access the network.
The solution for me was to reinstall VS Code using the "System Installer" instead of the "User Installer", thanks to the hint on this thread: https://github.com/Microsoft/vscode/issues/56657:
Can you uninstall the User Setup and install the System Setup and see whether that fixes it?
yes, i uninstall the user setup and try the system setup, and it works .
Upvotes: 0
Reputation: 3149
For me,it suddenly started working after 4 hours. I don't know if the problem was from my ISP or VSCode Extension server, but it somehow solved itself.
Upvotes: 0
Reputation: 29
You can also check if http_proxy is set as an environment variable and delete that line if set and no longer on a network that has proxy set-up.
Upvotes: 0
Reputation: 175
For me the problem was just that my proxy server was on, in my Windows machine. I was earlier working with network tracing, and it seemed to be causing the error.
Problem message:
Solution: resetting proxy settings
So I just turned off everything in proxy settings or you can reset it to default.
Upvotes: 0
Reputation: 867
In my case, the solution was to remove HTTPS_PROXY
(Could be HTTP_PROXY
) environment variable set during terminal initialisations.
Environment variables can be confirmed by env
command for most operating systems.
I removed the line which sets the environment variable for proxy from the bash
profile, then restarted the OS.
Apart from ~/.bashrc
for bash or any other sh-compatible shell, the environment variable could be in:
/etc/environment
: specifically meant for environment variables/etc/env.d/*
: environment variables, split in multiple files/etc/profile
: all types of initialization scripts/etc/profile.d/*
: initialization scripts/etc/bashrc
, /etc/bash.bashrc
: meant for functions and aliases~/.bash_profile
: initialization for login (bash-)shells~/.bashrc
: initialization for all interactive (bash-)shells~/.profile
: used for all shells~/.cshrc
, ~/.zshrc
, ~/.tcshrc
: similar for non-bash shellsCredit to this post. https://unix.stackexchange.com/a/249922
The environment variable HTTP(S)_PROXY
may be used by other applications. Therefore, be aware of the side effects of removing it.
Upvotes: 8
Reputation: 1147
Following worked for me :
Upvotes: 3
Reputation: 535
Same problem, updated VS Code on mac while connected to the VPN. After the update I got the XHR Error.
The solution was to stop the VPN, connect to the host and then reconnect the VPN and it seems to work normally. For now.
Upvotes: -1
Reputation: 10868
Same problem, easy solution: just login to Microsoft account and sync settings.
At least try this before all the other more complicated things?
Upvotes: 0
Reputation: 712
I faced the same problem, however no proxy or VPN. Solved it by entirely erasing my vscode config folders: %appdata%\Code and %userprofile%\.vscode. (As explained in https://stackoverflow.com/a/75473624/2381133.)
Upvotes: 1
Reputation: 113
This is an issue with the proxy setting.
And just restart visual studio code
Upvotes: 7
Reputation: 1415
I just restarted my entire computer and it worked.
I hate to have this dumb answer. But, I did look into most of the other answers. When something smells like a network issue and you "didn't change anything", it can be many things.
Upvotes: 0
Reputation: 405
I had same error: while fetching extensions xhr failed visual studio code on Mac and Windows.
VPN solved my problems.
Upvotes: -1
Reputation: 85
I had this problem in linux,
Manually downloading did not work with an error like: "Request was blocked due to exceeding usage of resource 'Count' in namespace AnnonymousID ..." (I did not save the full message unfortunately). I think Network speed was not an issue because my collage who was connected to same network was able to download extensions.
closing all instances of vscode and re-opening solved it.
Upvotes: 0
Reputation: 31
If you are using windows 11 with @binjie-liang answer, in your windows search for proxy settings and toggle off the Automatically Detect Settings. This will resolve the issue. Should be same with windows 10 also
Upvotes: 1
Reputation: 417
Using the task manager I noticed that I had another vscode-instance running that was not closed properly. Shutting every vscode instance down using the Task manager, restarting it I got two vscode-windows, closed one, could install in the remaining one.
Upvotes: 1
Reputation: 320
I had the same issue .. it's a very specific solution that worked for me but I hope it helps someone who will pass by here in the future:
Apparently .. I disconnected Cloudflare Zero Trust "Warp 1.1.1.1" in the CLI by mistake and some applications (vscode,firefox,skype ..) were using it .. so all I had to do was reconnect .. if your warp tray icon doesn't work like mine then all you have to do is type the command:
warp-cli connect
And all was back to working.
Upvotes: 1
Reputation: 415
Simply follow below steps:
At my end settings.json file
{
"http.proxyAuthorization": null,
"http.proxySupport": "on"
}
Upvotes: 25
Reputation: 71
Running Windows 11, it is Windows Firewall preventing it.
And that is it
Hope it works with you as well.
S.
Upvotes: 2
Reputation: 45
I have faced the same issue. And I delete the .vscode-server directory in server. Reconnect my server successful.
Upvotes: 1
Reputation: 497
so i find this
maybe this can help you.
Upvotes: 48
Reputation: 1447
In my case http_proxy
system environment
variable was set in Windows 10. After deleting that VS code started loading extensions.
Upvotes: 3
Reputation: 618
I don't use a proxy, and I do use NextDNS so I didn't want to change my DNS settings.
As a workaround, you can open code with --ignore-certificate-errors
flag, install any extensions, then restart without the flag.
On windows:
code --ignore-certificate-errors
Upvotes: 23
Reputation: 127
In my Windows machine deleting http_proxy User Environment Variable helped me.
Upvotes: 0
Reputation: 153
I faced this problem in 7-2022, and it's gone without even restart vscode. The reason was poor internet connection. If this is ur situation check the quality of your internet connection and just click refresh button, then extensions appear after a moment!
Upvotes: -1
Reputation: 1798
As far as I am aware the XHR error has several possible causes. The easiest fix which should be attempted prior to more complicated methods is restarting VS Code.
I have seen this error a couple of times and have been able to resolve it this way, for me it was not related to proxy settings, whereas for other users it might be. A possible relevant scenario is running a VS Code instance without restart or update over prolongued periods of time, such as days or even weeks.
Upvotes: 2