You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VS Code中Firefox调试器无法工作求助(Ubuntu 22.04 LTS)

Ubuntu 22.04下VS Code调试Angular/TypeScript的Firefox问题解决

错误1:connect ECONNREFUSED 127.0.0.1:6000

这是调试端口连接失败导致的,按以下步骤排查:

  • 先确认Angular开发服务已经启动,浏览器能正常打开http://localhost:4200
  • 关闭所有Firefox进程,在终端执行firefox --start-debugger-server 6000手动开启远程调试,再重新启动VS Code的调试任务
  • 检查VS Code是否安装了Firefox Debugger扩展,没有的话先安装
  • 修改launch.json,添加port字段明确指定调试端口,确保配置如下:
{
    "name": "Launch Firefox",
    "request": "launch",
    "type": "firefox",
    "url": "http://localhost:4200",
    "webRoot": "${workspaceFolder}",
    "port": 6000
}

错误2:Snap版Firefox提示“your firefox profile cannot be loaded. it may be missing or inaccessible”

Snap的沙箱限制会干扰调试时的配置文件读取,解决方法:

  • 关闭所有Firefox窗口,终端执行rm -rf ~/snap/firefox/common/.mozilla删除旧配置目录,重新启动Snap版Firefox,它会自动生成新的配置文件
  • 如果还是不行,打开Firefox输入about:profiles,找到默认配置文件的路径,把它添加到launch.json的profile字段里,示例:
{
    "name": "Launch Firefox",
    "request": "launch",
    "type": "firefox",
    "url": "http://localhost:4200",
    "webRoot": "${workspaceFolder}",
    "profile": "/home/你的用户名/snap/firefox/common/.mozilla/firefox/abc123.default-release"
}
  • 嫌麻烦的话直接用Flatpak版Firefox调试,你已经验证过它没有这个配置文件问题,更省心

内容的提问来源于stack exchange,提问作者Purushottam Nawale

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.15 13:45:04