在vscode中调试无服务器时未出现断点
问题描述:
在VSCode中调试基于无服务器的应用程序时,没有任何断点处于活动状态。在vscode中调试无服务器时未出现断点
launch.json
{
"configurations": [
{
"console": "integratedTerminal",
"cwd": "${workspaceRoot}",
"name": "Debug",
"port": 5858,
"request": "launch",
"runtimeArgs": [
"run-script",
"vscode:debug"
],
"runtimeExecutable": "npm",
"type": "node"
}
],
"version": "0.2.0"
}
我的package.json
...
"scripts": {
...
"vscode:debug": "export SLS_DEBUG=* && node --inspect=5858 --debug-brk --nolazy ./node_modules/.bin/serverless invoke local -s local -f customerAlexa -p ./test/requests/FindAgent-First-GoodZip.json"
},
....
当我从菜单中选择开始调试,所有的红色断点去灰色和程序公正的执行没有停止在断点。
我正在节点6.11.2,Mac上的无服务器1.23.0。谢谢大家。
答
这是我的launch.json,它允许我使用断点。
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceRoot}/node_modules/.bin/serverless",
"args": [
"offline",
"start",
"--skipCacheInvalidation"
],
"env": {
"NODE_ENV": "development"
}
}
我正在使用serverless-offline在本地运行。我也使用webpack和babel。 skipCacheInvalidation
就是这样。
我希望这可以指引您正确的方向。