Ubuntu 环境,Visual studio code 使用Firefox debugger的问题

125 阅读1分钟

Ubuntu 24环境,在Visual studio code 里面使用Firefox debugger启动Debug失败,错误信息:

Your Firefox profile cannot be loaded. It may be missing or inaccessible.

connect ECONNREFUSED 127.0.0.1:6000

原因是firefox 不能访问 /tmp 目录(用户组/用户是root),需要指定一个当前用户有写权限的目录。加 "tmpDir": "/some/folder/of/yours/with/write/perms" 到launch configuration里面解决了问题。

补充:之后遇到了HMR(Hot Module Replacement)问题,错误信息是 "file ... was not found", "XXX.js was not accepted"之类,没有找到原因。最终在Ubuntu安装了Edge浏览器,使用 Edge 的 debugger 不再出类似问题。