This is my first time installing and using VSCode, and when I try to install a python extension inside a VSCode application I get the error "Error While fetching extension. XHR failed" . How do I fix it?
image
first you open Vscode programming and do the following steps.
Press f1
Search user setting
Click enter
Search on user setting "proxy"
Click enter
Look for "use the proxy support for extensions."
Change override to on
The problem usually occurs because of the proxy settings.
try the following steps:
1.setting
2.proxy settings
3.Enable Detect automatically setting
4.restart
or
go to google search https://marketplace.visualstudio.com/
search for python then install python.
vscode->option-> user-> search 'proxy' ->clear 'http proxy" , it will be ok
Related
I develop an extenison and register onUri to receive the url "vscode://<extensionid>/". I publish the extension to the marketplace. When I open url in my webbrowser, the VSCode will be opened and ask me if need to install the extension.
But when I open an remote ssh window (I connect to remote cloud environment) and then open the url in browser, I receive "Extension xx is disabled, Would you like to enable the extension and open the url". I choose "enable" and then after few seconds, the same message occurred again!! It enters to infinite loop……
So I want to ask:
Is a VSCode bug?
How to solve it? Can I in some way make my extension enable in both local and remote?
Thank you!
When the extension kind is 'workbench':
VSCode 1.57.1 ,the infinite loop will occur, I think it is a bug
VSCode 1.65.2 , this problem does not exist
When the extension kind is 'ui', this problem does not exist in both 1.57.1 and 1.65.2
So, I finally solved it by adding this to package.json
"extensionKind": ["ui"]
recently I installed a fresh version of the KDE neon user edition and I updated it and works fine.
I also installed the vscode Debian version and nothing is wrong.
but when I want to login with my GitHub account in vscode for configs sync it opens a firefox tab that I log in to my GitHub and authorizes the vscode and it succeeds and gets back to vscode and instead of signing in and syncing the configs it opens an empty unsaved file named something like this:
did-authenticate\?windowid\=1\&code\=6beea2fcb8a47e0ea49e\&state\=2efc5efd-9c68-4735-a4a0-fd690dd7aec0
in this path : "~/vscode:/vscode.GitHub-authentication"
and after a few seconds canceled notification appears.
I've installed vscode for Debian version 1.63.2 which people in this Github issue had the same problem in version 1.62.2 and they are saying that this problem is fixed for them in version 1.62.3.
I don't have this problem with the Microsoft account sign-in.
what am I missing?
Update:
for testing, I tried to install an extension for vscode and I pasted the URL with vscode protocol in a web browser like this (vscode:extension/GitHub.vscode-pull-request-github), and instead of opening the vscode extensions tab, it goes back to vscode and opens an empty file in the same directory ("~/vscode:/vscode.GitHub-authentication").
so this is vscodes fault that cant handle the vscode: URLs.
I found out what the problem is but I don't know how to fix it
for the record I've updated the vscode today to the 1.64.1 version and still have the problem.
enter image description here
First, you need to get the GitHub Pull Requests and Issues and GitHub extensions together. Then go to the section specified in the photo and give the details of the account and repository you are using. And then it will be fixed.
I ran into this issue myself and discovered that it's because the VS Code command-line application isn't designed to handle URLs, but local file paths. VS Code registers the vscode:// URL scheme with XDG using an appropriate *.desktop file and these URLs should be opened using the command-line program xdg-open. In Firefox, if you have not yet set a default application for vscode:// URLs, then it will ask you for a program to open it with, select /usr/bin/xdg-open. If you have already set it to a different default, you can change it as follows: go to the Menu -> Settings -> General -> Applications -> vscode -> Use other... -> Select /usr/bin/xdg-open as the program for vscode.
With the default for vscode:// URLs set to use xdg-open, then any future integration with VS Code should work naturally to open it as expected.
I am getting "Server is started at 5500 but failed to open browser. Try to change the CustomBrowser settings." in VScode while using line server. I have tried to change default settings but i still can't solve it.
In VScode go to extension (ctrl+shift+x) and search for live server, on live server go to manage > extension setting, then look for Live Server > Settings:Use Browser Preview section in the settings.
If the checkbox is checked, uncheck it.
The error promt says : "Server is started at 5500 but failed to open in browser preview. Got browser preview extension installed?"
In your setting, you can navigate to the Extensions and to the Live Server Compiler section. There, uncheck the box labeled "Live Server > Settings: Use Browser Preview"
If this doesn't help, try reinstalling the extension and check if vscode is running on the latest version
When trying to install a VSCODE extension from the marketplace, I'm getting connect ETIMEDOUT xxx.xxx.xxx.xxx:443 possibly due to company firewall restrictions.
Is there a way to download and install extensions from a local drive? I couldn't find a "download" option on the VSCODE marketplace.
You need to add your corporate proxy to VSCode settings.
Step 1.
Open File > Preferences > User Settings
Step 2.
Copy and Paste below into the settings.json (file that opens) make sure is inside the curly brackets {}
//-------- HTTP configuration --------
// The proxy setting to use. If not set will be taken from the http_proxy and https_proxy environment variables
"http.proxy": "http://127.0.0.1:8080", //your corporate proxy
// Whether the proxy server certificate should be verified against the list of supplied CAs.
"http.proxyStrictSSL": false
Step 3.
Press F1 and type Reload Window and press enter to refresh.
Tip: if you don't know your corporate proxy settings, follow this
advice:
https://superuser.com/questions/346372/how-do-i-know-what-proxy-server-im-using
Here is what you can do.
Most extensions are in public repos. Click Getting Started on the side panel.
Download the code from the public repo.
Follow the instructions in the docs to side load the application.
If you want to share your extension or customization with others
privately, you can simply send them a copy of the output from the
generator and ask them to add it under their .vscode/extensions
folder. Alternatively, package your extension using the vsce
publishing tool and send them the .vsix file.
Add proxy configuration to VS Code
Open VS Code as Administrator
Open File > Preferences > User Settings
Add following configuration to the open file.
{
"http.proxy": "http://userName:password#companyProxyURL:portNumber",
"http.proxyStrictSSL": false
}
Same issue. VS Code clearly not talking to extension server.
code --install-extension <extension>
gave a time-out message.
Turned out that I had bogus settings of HTTP_PROXY and HTTPS_PROXY. Unset the environment variables and VS Code worked beautifully.