3
0
热心网友
1.Create a file named .vscode/launch.json
.vscode/launch.json
{ "version": "0.2.0", "configurations": [ { "name": "Next.js: debug server-side", "type": "node-terminal", "request": "launch", "command": "npm run dev" }, { "name": "Next.js: debug client-side", "type": "chrome", "request": "launch", "url": "http://localhost:3000" }, { "name": "Next.js: debug client-side (Firefox)", "type": "firefox", "request": "launch", "url": "http://localhost:3000", "reAttach": true, "pathMappings": [ { "url": "webpack://_N_E", "path": "${workspaceFolder}" } ] }, { "name": "Next.js: debug full stack", "type": "node", "request": "launch", "program": "${workspaceFolder}/node_modules/.bin/next", "runtimeArgs": ["--inspect"], "skipFiles": ["<node_internals>/**"], "serverReadyAction": { "action": "debugWithEdge", "killOnServerStop": true, "pattern": "- Local:.+(https?://.+)", "uriFormat": "%s", "webRoot": "${workspaceFolder}" } } ] }
2.Terminal
yarn add win-node-env
3.Terminal
set NODE_OPTIONS=--inspect
4.update the dev script on your package.json:
{ "scripts": { "dev": "NODE_OPTIONS='--inspect' next dev" } }
5.Open a new tab and visit chrome://inspect6.Click inspect to open a separate DevTools window.Configuring: Debugging | Next.js
使用道具 舉報
本版積分規則 發表回覆 回帖並轉播 回帖後跳轉到最後一頁
相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com
Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.