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 by following the steps here. https://github.com/Microsoft/vscode-recipes/tree/master/Next-js and modified it to run for chrome canary.
{
"version": "0.2.0",
"configurations": [
{
"name": "Chrome Canary",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000/",
"runtimeExecutable": "C:/Users/myusername/AppData/Local/Google/Chrome SxS/Application/chrome.exe",
"webRoot": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
"name": "Next: Node",
"runtimeExecutable": "next",
"runtimeArgs": [
"--inspect"
],
"port": 9229,
"console": "integratedTerminal"
}
],
"compounds": [
{
"name": "Next: Full",
"configurations": [
"Next: Node",
"Chrome Canary"
]
}
]
}
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"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With