使用npm start时如何使用typescript将VSCode调试器附加到azure函数?

问题描述 投票:0回答:1

我正在使用'npm start',其工作方式如下:

"watch": "tsc -w",
    "prestart": "npm run build && func extensions install",
    "start:host": "func start --cors *",
    "start": "npm run start:host & npm run watch",

这很好用,但我无法通过vscode,launch.json附加到它:

{“name”:“Attach”,“type”:“node”,“request”:“attach”,“cwd”:“$ {workspaceFolder}”,“protocol”:“auto”,“port”:9229}

当我尝试附加时,我收到错误:

enter image description here

typescript visual-studio-code azure-functions
1个回答
0
投票

这似乎是vs代码的Chrome问题。您必须启用Chrome并启用远程调试才能将扩展程序附加到它。

我已经针对不同场景的类似问题发布了答案,请尝试查看它是否适合您。

您必须启用Chrome并启用远程调试才能将扩展程序附加到该Chrome。

视窗

右键单击Chrome快捷方式,然后选择属性在“目标”字段中,追加--remote-debugging-port = 9229或在命令提示符下,执行/chrome.exe --remote-debugging-port = 9229

OS X.

在终端中,执行/ Applications / Google \ Chrome.app/Contents/MacOS/Google \ Chrome --remote-debugging-port = 9229

Linux的

在终端中,启动google-chrome --remote-debugging-port = 9229

https://github.com/Microsoft/vscode-chrome-debug

© www.soinside.com 2019 - 2024. All rights reserved.