How do you manage to debug the server side in VS Code?

I've been trying various configurations, but the breakpoints are unbound for some reason. configurations I tried:
{
"name": "Next.js: debug server-side",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev",
"sourceMaps": true,
"sourceMapPathOverrides": {
"/turbopack/[project]/*": "${webRoot}/*"
}
},
{
"type": "node",
"request": "launch",
"name": "Next.js: Debug",
"runtimeExecutable": "pnpm",
"runtimeArgs": ["dev"],
"env": {
"NODE_OPTIONS": "--inspect=9228"
},
"skipFiles": ["<node_internals>/**"],
"console": "integratedTerminal"
},
{
"name": "Attach",
"port": 9229,
"request": "attach",
"skipFiles": ["<node_internals>/**"],
"type": "node"
},
{
"name": "Next.js: debug API (server-side)",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/next/dist/bin/next",
"args": ["dev"],
"cwd": "${workspaceFolder}",
"autoAttachChildProcesses": true,
"skipFiles": ["<node_internals>/**"],
"serverReadyAction": {
"pattern": "started server on .+? \\(http://.+?\\)",
"uriFormat": "%s",
"action": "openExternally"
}
}
{
"name": "Next.js: debug server-side",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev",
"sourceMaps": true,
"sourceMapPathOverrides": {
"/turbopack/[project]/*": "${webRoot}/*"
}
},
{
"type": "node",
"request": "launch",
"name": "Next.js: Debug",
"runtimeExecutable": "pnpm",
"runtimeArgs": ["dev"],
"env": {
"NODE_OPTIONS": "--inspect=9228"
},
"skipFiles": ["<node_internals>/**"],
"console": "integratedTerminal"
},
{
"name": "Attach",
"port": 9229,
"request": "attach",
"skipFiles": ["<node_internals>/**"],
"type": "node"
},
{
"name": "Next.js: debug API (server-side)",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/next/dist/bin/next",
"args": ["dev"],
"cwd": "${workspaceFolder}",
"autoAttachChildProcesses": true,
"skipFiles": ["<node_internals>/**"],
"serverReadyAction": {
"pattern": "started server on .+? \\(http://.+?\\)",
"uriFormat": "%s",
"action": "openExternally"
}
}
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?