【问题标题】:unexpected server response (400)意外的服务器响应 (400)
【发布时间】:2018-02-08 15:24:32
【问题描述】:

根据here,我正在尝试设置 VSCode 以使用 Edge 进行调试,但是,尽管我安装了 VSCode 扩展:Edge 调试器。 VSCode 中的 Launch.json 文件如下:

{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [       
    {
        "type": "edge",
        "request": "launch",
        "name": "Launch Program",
        "url": "http://localhost:4200",
        "webRoot": "${workspaceRoot}/",
        "sourceMaps": true
    }
    ,
    {
        "name": "attach to my-app",
        "type": "edge",
        "request": "attach",            
        "port": 9222,
        "url": "http://localhost:4200/",
        "webRoot": "${workspaceRoot}/",
        "diagnosticLogging": true
    }
]
}

我正在从上面的“附加到我的应用程序”选项中启动 VSCode 调试器。 my-app 项目是一个 Angular2 快速入门示例,您可以在 this pagecode here 上找到。我总是在 VSCode 中遇到“[debugger-for-chrome] 意外的服务器响应(400)”。

如果你对使用 VSCode 调试 Angular2/typescript 项目有任何想法,欢迎留言。

【问题讨论】:

标签: angular typescript debugging visual-studio-code microsoft-edge


【解决方案1】:

指定的端口属性与您包含在 URL 属性中的端口不匹配。

除了一般调试问题,建议您尝试 Chrome 的 DevTools。在这种情况下,生成 400 的代码很可能不在 Angular 端的用户代码中,而是从外部资源生成的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-26
    • 1970-01-01
    相关资源
    最近更新 更多