尝试使用“附加到Chrome"在VSCode中进行调试时出错;使用Debugger For Chrome插件的选项 [英] Error trying to debug in VSCode with "Attach to Chrome" option using Debugger For Chrome plugin

查看:614
本文介绍了尝试使用“附加到Chrome"在VSCode中进行调试时出错;使用Debugger For Chrome插件的选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Visual Studio代码.
打字稿文件将被编译为带有源映射的JavaScript文件. 生成的launch.json:

Visual Studio Code.
Typescript files are compiled to JavaScript files with sourcemaps. Generated launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://localhost:8080",
            "webRoot": "${workspaceRoot}"
        },
        {
            "type": "chrome",
            "request": "attach",
            "name": "Attach to Chrome",
            "port": 9222,
            "webRoot": "${workspaceRoot}"
        }
    ]
}

Chrome使用以下参数启动:--remote-debugging-port = 9222

Chrome is started with parameter: --remote-debugging-port=9222

但是我仍然得到

无法连接到目标:连接ECONNREFUSED 127.0.0.1:9222

错误.

推荐答案

使用带*的'urlFIlter'作为通配符将解决您的问题.

Using 'urlFIlter' with * as wildcard will fix your problem.

此处中查看我的答案.

这篇关于尝试使用“附加到Chrome"在VSCode中进行调试时出错;使用Debugger For Chrome插件的选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆