Skip to content Skip to sidebar Skip to footer

Debugging Nextjs App In Chrome And Vscode

I have inserted this snippet in my launch.json file. It always opens up chrome and is stuck at about:blank, and then vscode gives the timeout error. I built this launch.json file b

Solution 1:

Debug Nextjs program without custom server, use the configuration:

{
  "type": "node",
  "request": "launch",
  "name": "Launch via NPM",
  "runtimeExecutable": "${workspaceFolder}\\node_modules\\.bin\\next",
  "port": 9229,
  "env": {
    "NODE_OPTIONS": "--inspect"
  }
}

Debug Nextjs program with custom server, use the configuration:

{
  "type": "node",
  "request": "launch",
  "name": "Next: Node",
  "program": "${workspaceFolder}/server.js",
  "runtimeArgs": [
      "--inspect"
  ],
  "port": 9229,
  "console": "integratedTerminal"
}

Post a Comment for "Debugging Nextjs App In Chrome And Vscode"