該
外層 pacakge.json 代碼(即路徑:社交網路/pacakge.json”
{
"name": "socialnetwoek",
"version": "1.0.0",
"description": "social network backend",
"main": "server.js",
"type": "module",
"scripts": {
"start": "node backend/server",
"server": "nodemon backend/server",
"client": "npm run dev --prefix frontend",
"all": "concurrently \"npm run server\" \"npm run client\""
},
"author": "Vivek Padelkar",
"license": "ISC",
"dependencies": {
"bcryptjs": "^2.4.3",
"colors": "^1.4.0",
"cors": "^2.8.5",
"dotenv": "^10.0.0",
"esm": "^3.2.25",
"express": "^4.17.1",
"express-async-handler": "^1.2.0",
"joi": "^17.4.2",
"mongoose": "^6.0.12",
"morgan": "^1.10.0"
},
"devDependencies": {
"concurrently": "^6.4.0",
"nodemon": "^2.0.15"
}
}
我正在遵循的步驟:
- 在根檔案夾(即社交網路)中,我正在執行命令 npm run all。
- 然后我按 F5 運行除錯器。
下面是我的 vs 螢屏,我正在使用 chrome 運行我的 Next.js 應用程式,所有除錯點都變灰了。(用紅色框突出顯示)
但沒有任何作業。
注意:我是 Next.Js 的新手,可能我在檔案夾結構或代碼中搞砸了。您的寶貴幫助將不勝感激,提前致謝
uj5u.com熱心網友回復:

uj5u.com熱心網友回復:
終于找到了解決方案,我已經按照以下方式編輯了我的 launch.json 并且一切都按預期作業,感謝您的寶貴時間。
launch.json
{
"configurations": [
{
"name": "Launch Chrome",
"request": "launch",
"type": "pwa-chrome",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}/frontend"
},
{
"name": "Attach to Edge",
"port": 9222,
"request": "attach",
"type": "pwa-msedge",
"webRoot": "${workspaceFolder}/frontend"
},
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
},
{
"name": "Launch Edge",
"request": "launch",
"type": "pwa-msedge",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}/frontend"
},
{
"name": "Launch Microsoft Edge and open the Edge DevTools",
"request": "launch",
"type": "vscode-edge-devtools.debug",
"url": "http://localhost:3000" // Provide your project's url to finish configuring
}
]
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/365222.html
標籤:反应 调试 视觉工作室代码 下一个.js vscode 调试器
