意外的服务器响应(400)



尽管我安装了VSCode扩展:Debugger for 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调试器。我的应用程序项目是一个Angular2 QuickStart示例,您可以在这个页面上找到这里的代码。我总是遇到VSCode中显示的"[chrome调试器]意外服务器响应(400("。

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

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

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

最新更新