Created
November 8, 2022 00:28
-
-
Save gabrielmlinassi/d8fe152c22c60165caad560424e8f8d2 to your computer and use it in GitHub Desktop.
Setup VSCode Debbuger (Best Way)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .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