“XHR failed” 无法下载任何扩展

huangapple go评论114阅读模式
英文:

"XHR failed" can't download any extension

问题

最近我在尝试下载扩展时遇到了"XHR failed"错误,尝试了很多不同的设置更改,但仍然无法解决。所以我决定尝试不同的Wi-Fi(学校的Wi-Fi)和移动数据网络,我惊讶地发现它正常工作。所以,我猜问题出在我的Wi-Fi上。如何处理?

我在Windows 11上使用最新的VS CODE版本。

我尝试了很多方法来修复它,还查阅了GitHub和Stack Overflow,包括代理设置、防火墙、DNS、重启路由器、重启笔记本电脑。我还尝试了这个问题中的所有方法,但是"XHR failed"错误一直出现,就像我之前说的,只要更改Wi-Fi就可以正常工作。所以,我希望能在我的Wi-Fi上找到解决方案。

这是终端上的错误消息:
查看图片说明


更新:

  1. 我在家和学校运行相同的项目。

    我在家和学校使用同一台笔记本电脑。

  2. 通过"移动数据",我指的是来自我的手机服务的热点(而不是Wi-Fi)。

  3. 该项目只在学校的Wi-Fi和我的热点上工作。

    它不适用于我的家庭Wi-Fi。

  4. 不仅对于远程资源管理器,还对于其他情况都会出现"XHR failed"错误。

    我无法尝试重新加载我想要下载的扩展。错误总是发生,不仅在远程资源管理器上。

  5. 另一个问题是"无法通过RPC连接到Discord: 错误:无法连接"。

英文:

So recently I get this error "XHR failed" while trying to download extension and I already try a lot of things changing the setting but still it can't work. So I decided to try difference Wi-Fi (mySchool) and network (mobile data) and I'm shocked it's working fine. So, I guess the problem is on my own Wi-Fi. How to deal with it?

I use the latest VS CODE version on Windows 11.

I try a lot of things to fix it and been through GitHub and Stack Overflow too from proxy setting, firewall, DNS, restart router, restart laptop. Also I tried everything in this question too and all but

> "XHR failed"

keeps appear and as I said before without changing any setting but only changing Wi-Fi it works fine. So, I hope there's a solution on my Wi-Fi.

“XHR failed” 无法下载任何扩展

this is the error msgs on therminal:
enter image description here


Updates:

  1. I'm running the same project at home and school.

    I'm using the same laptop at home and school

  2. By "mobile data", I mean hotspot from my cell service (vs. Wi-Fi).

  3. The projects ONLY works for Wi-Fi at school and from my hotspot.

    It does NOT work from my home Wi-Fi.

  4. It fails not only for remote explorer, but the other ones too.

    I can't try to reload the extension that I want to download. The error always occurs, not only on Remote Explorer.

  5. The other problem is "can't connect to discord via RPC: Error: could not connect"

答案1

得分: 1

  1. 你的问题与这个帖子中讨论的问题相同:

  2. 不幸的是,有几种不同可能的根本原因,以及在帖子中讨论的几种不同的解决方法和解决方案。

  3. 你说你“尝试了几种方法”。请更新你的帖子,明确说明你尝试了什么以及结果如何。

  4. 你说在某些网络上“正常工作”,但在你的(家庭?学校?其他?)网络上失败(无论网络是否“wifi”可能都无关紧要)。请明确说明在这些网络之间“有什么不同”(在你的了解范围内)。

  5. 请指定你正在运行 VSCode 的平台(Windows?MacOS?Linux?其他?)

  6. 尝试这个(上面引用的 SO 帖子中的一个回复):

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

    1. 按下 f1
    2. 搜索“用户设置”
    3. 按下回车
    4. 在用户设置中搜索“代理”
    5. 按下回车
    6. 寻找“为扩展使用代理支持”
    7. 将“覆盖”更改为打开

Q1: 你正在使用相同版本的VS Code,在Windows上,在家和学校使用相同的项目,对吗?

<= Q: 你是在同一台电脑上使用(例如,从家里携带笔记本电脑到学校),还是在家和学校使用不同的电脑?

Q2. 通过“移动数据”(与“wifi”相对),你是指你用手机服务的“热点”,对吗?

Q3. 项目在Wifi上总是正常工作(无论是在家还是学校),但在你的热点上永远不正常,对吗?

Q4. 当错误发生时,你总是尝试在VS Code中运行远程资源管理器扩展(不会发生在其他VSCode活动中),对吗?

<= Q: 在VSCode的其他领域有任何问题吗(例如,你的编译器)?

Q5. 准确的错误消息是“The editor could not be opened due to an unexpected error: XHR failed”,对吗?

<= Q: 一直在使用Remote Explorer,对吗?你在Remote Explorer中具体在做什么?

确保尝试这里的所有故障排除提示

(包括从VSCode命令行验证“ssh”,在你的“坏”网络上使用):

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

英文:
  1. Your problem is the same as discussed in this thread:

  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 &quot;user setting&quot;
> 3. click enter
> 4. search on user setting &quot;proxy&quot;
> 5. click enter
> 6. look for "use the proxy support for extensions."
> 7. change &quot;override&quot; 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

答案2

得分: 1

我找到了解决我的问题的方法。通过使用 VPN 来解决了问题。
问题可能是我的 WiFi 供应商在 VS Code 上阻止了请求,似乎 DNS 政策有点可疑。希望这也能有所帮助。

英文:

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. Hope this can help too

答案3

得分: 0

在我的情况下,重新启动我的win12笔记本解决了这个问题。

因为有时我不得不暂时在我的防火墙上打开特定的端口,有时它会阻止“随机”应用程序,直到重新启动。

英文:

In my case, a reboot of my win12 laptop solved the problem.

Because sometimes I have to temporarily open specific ports on my firewall, sometimes it blocks "random" apps until reboot.

huangapple
  • 本文由 发表于 2023年2月6日 08:40:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/75356488.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定