如何在Visual Studio代码中调试Aleph应用程序?
注意:我指的是调试在Aleph框架内运行的应用程序,而不是实际调试Aleph本身。
与Nextjs相似(但当然不相同):
启动服务器:
$ aleph dev -reload
http://localhost:8084/上的信息服务器就绪
然后尝试附加到launch.json中的进程
"configurations": [
{
"type": "pwa-node",
"name": "Aleph: Run",
"request": "attach",
"port": 8084
},但是没有机会。有没有人在Aleph中使用过这种配置?
在我添加了你的launch.json @Dizzy之后抛出
启用JS调试器(夜间):
处理启动时出错:错误:无法连接到位于http://127.0.0.1:8080的调试目标:在异步进程的runMicrotasks ()处取消了Promise (内部/ processTicksAndRejections /processTicksAndRejections_ http://127.0.0.1:8080:97:5)at async P.launch (/Users/aadams/.vscode/extensions/ms-vscode.js-debug-nightly-2021.3.3017/src/extension.js:59:152076) at async t.Binder._launch (/Users/aadams/.vscode/extensions/ms-vscode.js-debug-nightly-2021.3.3017/src/extension.js:1:135988) at async t.Binder.captureLaunch (/Users/aadams/.vscode/extensions/ms-vscode.js-debug-nightly-2021.3.3017/src/extension.js:59:151627) async (/Users/aadams/.vscode/extensions/ms-vscode.js-debug-nightly-2021.3.3017/src/extension.js:59:150887) (/Users/aadams/.vscode/extensions/ms-vscode.js-debug-nightly-2021.3.3017/src/extension.js:1:88464)的async Promise.all (索引3) async t.Binder._boot t.default._onMessage
启用JS调试器后:
处理启动时出错:错误:无法连接到位于http://127.0.0.1:8080的调试目标: Promise在e (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/extension.js:1:114976) at runMicrotasks () )位于processTicksAndRejections (内部/进程/任务_队列:97:5)在异步t (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/extension.js:59:61879) at asyncP.launch (/Applications/异步t.Binder.captureLaunch中的Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/extension. (/Applications/异步t.Binder._launch中的Visual Studio P.launch (/Applications/Visual Studio t.Binder.captureLaunchjs:59:151627) async Promise.all (索引3) async t.Binder._boot (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/extension.js:1:88464) at async t.Binder._boot (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/extension.js:1:88464)
发布于 2021-04-05 05:36:21
这不是完全有效,因为断点没有命中。但是你可以把debugger放到你的代码中,它就到此为止了。
.vscode/launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Deno: Run",
"request": "launch",
"type": "pwa-node",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "deno",
"runtimeArgs": [
"run",
"--inspect",
"--unstable",
"-A",
"https://deno.land/x/aleph@v0.3.0-alpha.25/cli.ts"
],
"args": ["dev"],
"attachSimplePort": 9229,
"outputCapture": "std"
}
]
}https://stackoverflow.com/questions/66898338
复制相似问题