Skip to content

Instantly share code, notes, and snippets.

@gabrielmlinassi
Created November 8, 2022 00:28
Show Gist options
  • Save gabrielmlinassi/d8fe152c22c60165caad560424e8f8d2 to your computer and use it in GitHub Desktop.
Save gabrielmlinassi/d8fe152c22c60165caad560424e8f8d2 to your computer and use it in GitHub Desktop.
Setup VSCode Debbuger (Best Way)
# .vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Launch Program",
"skipFiles": ["<node_internals>/**"],
"port": 9229
}
]
}
# Start dev server with NODE_OPTIONS='--inspect' flag. Gotta create a script for that on package.json
{
"scripts": {
...
"devi": "NODE_OPTIONS='--inspect' next dev -p 4000",
}
}
# Run:
# 1. npm run devi
# 2. Launch debugger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment