DEV Community

ccsunny
ccsunny

Posted on

How to debug Next.js with Vscode and chrome

What's AMP

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "chrome",
      "request": "launch",
      "name": "Launch Chrome",
      "url": "http://localhost:3001",
      "webRoot": "${workspaceFolder}"
    },
    {
      "type": "node",
      "request": "launch",
      "name": "Launch Next.js",
      "runtimeExecutable": "npm",
      "runtimeArgs": [
        "run",
        "dev"
      ],
      "port": 9229
    }
  ],
  "compounds": [
    {
      "name": "Debug Next.js + Chrome",
      "configurations": [
        "Launch Next.js",
        "Launch Chrome"
      ]
    }
  ]
}

Enter fullscreen mode Exit fullscreen mode

Top comments (0)