我已经在我的 launch.json 文件中插入了这个片段。它总是打开chrome并卡在about:blank,然后vscode给出超时错误。我按照此处的步骤构建了这个 launch.json 文件。 https://github.com/Microsoft/vscode-recipes/tree/master/Next-js并修改它以运行 chrome canary。
{
"version": "0.2.0",
"configurations": [
{
"name": "Chrome Canary",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000/",
"runtimeExecutable": "C:/Users/myusername/AppData/Local/Google/Chrome SxS/Application/chrome.exe",
"webRoot": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
"name": "Next: Node",
"runtimeExecutable": "next",
"runtimeArgs": [
"--inspect"
],
"port": 9229,
"console": "integratedTerminal"
}
],
"compounds": [
{
"name": "Next: Full",
"configurations": [
"Next: Node",
"Chrome Canary"
]
}
]
}