Next.js Discord

Discord Forum

Full stack debugging on VSCode not working (Windows)

Unanswered
American posted this in #help-forum
Open in Discord
AmericanOP
{
  "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 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}"
      }
    }
  ]
}


This is my launch.json (copied from the docs) and I attached the error that I get. Googling this issue didn't give anything useful since the config seems different from previous/older versions of nextjs. Any help would be appreciated :)

3 Replies

Schneider’s Smooth-fronted Caiman
I have this issue too, my client side profile works fine but server and full stack don't. Have you found a solution?
Schneider’s Smooth-fronted Caiman
Update: I think I fixed it by updating my full stack profile to the following
{
  "name": "Next.js: debug full stack",
  "type": "node-terminal",
  "request": "launch",
  "command": "npm run dev",
  "cwd": "${workspaceFolder}", //you may need to change this to the root of your project
  "serverReadyAction": {
    "pattern": "started server on .+, url: (https?://.+)",
    "uriFormat": "%s",
    "action": "debugWithChrome"
  }
}
AmericanOP
Will try, cheers :)