Can't get VSCode debbuging to work with my NodeJs app
up vote
0
down vote
favorite
I'm having trying to debug my app on Visual Studio Code. I have the following config on my package.json
:
"scripts":
"build": "rimraf dist/ && babel ./ --out-dir dist/ --ignore ./node_modules,./.babelrc,./package.json,./npm-debug.log --copy-files",
"start": "npm run build && node --inspect=12345 dist/app.js"
Im using ES6 on my Node app, that's why it is kinda messy my build
config.
When I run npm start
everything works fine, I can use my app.
Now to try to debug it, I have set the following launch
configurations:
"configurations": [
"type": "node",
"name": "Attach to Remote",
"request": "attach",
"port": 12345
,
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "$workspaceFolder\dist\app.js"
]
Both of them ""work"": VS Code switch to "debug mode" but I can't hit any breakpoints. They all get grayed out:
I have tried to fix using this answer, but couldn't get it to work...
Any help?
Thanks in advance!
node.js debugging visual-studio-code vscode-debugger
add a comment |
up vote
0
down vote
favorite
I'm having trying to debug my app on Visual Studio Code. I have the following config on my package.json
:
"scripts":
"build": "rimraf dist/ && babel ./ --out-dir dist/ --ignore ./node_modules,./.babelrc,./package.json,./npm-debug.log --copy-files",
"start": "npm run build && node --inspect=12345 dist/app.js"
Im using ES6 on my Node app, that's why it is kinda messy my build
config.
When I run npm start
everything works fine, I can use my app.
Now to try to debug it, I have set the following launch
configurations:
"configurations": [
"type": "node",
"name": "Attach to Remote",
"request": "attach",
"port": 12345
,
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "$workspaceFolder\dist\app.js"
]
Both of them ""work"": VS Code switch to "debug mode" but I can't hit any breakpoints. They all get grayed out:
I have tried to fix using this answer, but couldn't get it to work...
Any help?
Thanks in advance!
node.js debugging visual-studio-code vscode-debugger
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm having trying to debug my app on Visual Studio Code. I have the following config on my package.json
:
"scripts":
"build": "rimraf dist/ && babel ./ --out-dir dist/ --ignore ./node_modules,./.babelrc,./package.json,./npm-debug.log --copy-files",
"start": "npm run build && node --inspect=12345 dist/app.js"
Im using ES6 on my Node app, that's why it is kinda messy my build
config.
When I run npm start
everything works fine, I can use my app.
Now to try to debug it, I have set the following launch
configurations:
"configurations": [
"type": "node",
"name": "Attach to Remote",
"request": "attach",
"port": 12345
,
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "$workspaceFolder\dist\app.js"
]
Both of them ""work"": VS Code switch to "debug mode" but I can't hit any breakpoints. They all get grayed out:
I have tried to fix using this answer, but couldn't get it to work...
Any help?
Thanks in advance!
node.js debugging visual-studio-code vscode-debugger
I'm having trying to debug my app on Visual Studio Code. I have the following config on my package.json
:
"scripts":
"build": "rimraf dist/ && babel ./ --out-dir dist/ --ignore ./node_modules,./.babelrc,./package.json,./npm-debug.log --copy-files",
"start": "npm run build && node --inspect=12345 dist/app.js"
Im using ES6 on my Node app, that's why it is kinda messy my build
config.
When I run npm start
everything works fine, I can use my app.
Now to try to debug it, I have set the following launch
configurations:
"configurations": [
"type": "node",
"name": "Attach to Remote",
"request": "attach",
"port": 12345
,
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "$workspaceFolder\dist\app.js"
]
Both of them ""work"": VS Code switch to "debug mode" but I can't hit any breakpoints. They all get grayed out:
I have tried to fix using this answer, but couldn't get it to work...
Any help?
Thanks in advance!
node.js debugging visual-studio-code vscode-debugger
node.js debugging visual-studio-code vscode-debugger
asked Nov 10 at 14:04
João Menighin
1,23241939
1,23241939
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
I am using VS Code v 1.28.2 and I'm able to debug both ways.
1) With the built in debuger ( Menu -> Debug -> Start Debuging)
2) starting the application with node inspect index.js
. In that case you have to declare breakpoints in your code with the debugger;
keyword. Then, when in debug-mode and stoped in a breakpoint, you continue execution typing cont
in the command line.
hope it helps
Thanks for the answer, gkont. This did work but I was expecting to use breakpoints instead of debugger. I found out a solution! Thanks!
– João Menighin
Nov 10 at 17:03
add a comment |
up vote
0
down vote
accepted
I found out I was just missing the --source-maps
from my babel-cli
command... -.-
After adding it, VSCode is able to find the breakpoints.
So basically the solution was:
Add --source-maps
to my build command:
"scripts":
"build": "rimraf dist/ && babel ./ --out-dir dist/ --ignore ./node_modules,./.babelrc,./package.json,./npm-debug.log --copy-files --source-maps",
"start": "npm run build && node --inspect=12345 dist/app.js"
And I configured a launch
as follows:
"configurations": [
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "$workspaceFolder\dist\app.js",
"preLaunchTask": "npm: build"
]
Hope it helps someone!
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
I am using VS Code v 1.28.2 and I'm able to debug both ways.
1) With the built in debuger ( Menu -> Debug -> Start Debuging)
2) starting the application with node inspect index.js
. In that case you have to declare breakpoints in your code with the debugger;
keyword. Then, when in debug-mode and stoped in a breakpoint, you continue execution typing cont
in the command line.
hope it helps
Thanks for the answer, gkont. This did work but I was expecting to use breakpoints instead of debugger. I found out a solution! Thanks!
– João Menighin
Nov 10 at 17:03
add a comment |
up vote
0
down vote
I am using VS Code v 1.28.2 and I'm able to debug both ways.
1) With the built in debuger ( Menu -> Debug -> Start Debuging)
2) starting the application with node inspect index.js
. In that case you have to declare breakpoints in your code with the debugger;
keyword. Then, when in debug-mode and stoped in a breakpoint, you continue execution typing cont
in the command line.
hope it helps
Thanks for the answer, gkont. This did work but I was expecting to use breakpoints instead of debugger. I found out a solution! Thanks!
– João Menighin
Nov 10 at 17:03
add a comment |
up vote
0
down vote
up vote
0
down vote
I am using VS Code v 1.28.2 and I'm able to debug both ways.
1) With the built in debuger ( Menu -> Debug -> Start Debuging)
2) starting the application with node inspect index.js
. In that case you have to declare breakpoints in your code with the debugger;
keyword. Then, when in debug-mode and stoped in a breakpoint, you continue execution typing cont
in the command line.
hope it helps
I am using VS Code v 1.28.2 and I'm able to debug both ways.
1) With the built in debuger ( Menu -> Debug -> Start Debuging)
2) starting the application with node inspect index.js
. In that case you have to declare breakpoints in your code with the debugger;
keyword. Then, when in debug-mode and stoped in a breakpoint, you continue execution typing cont
in the command line.
hope it helps
answered Nov 10 at 14:57
gkont
1039
1039
Thanks for the answer, gkont. This did work but I was expecting to use breakpoints instead of debugger. I found out a solution! Thanks!
– João Menighin
Nov 10 at 17:03
add a comment |
Thanks for the answer, gkont. This did work but I was expecting to use breakpoints instead of debugger. I found out a solution! Thanks!
– João Menighin
Nov 10 at 17:03
Thanks for the answer, gkont. This did work but I was expecting to use breakpoints instead of debugger. I found out a solution! Thanks!
– João Menighin
Nov 10 at 17:03
Thanks for the answer, gkont. This did work but I was expecting to use breakpoints instead of debugger. I found out a solution! Thanks!
– João Menighin
Nov 10 at 17:03
add a comment |
up vote
0
down vote
accepted
I found out I was just missing the --source-maps
from my babel-cli
command... -.-
After adding it, VSCode is able to find the breakpoints.
So basically the solution was:
Add --source-maps
to my build command:
"scripts":
"build": "rimraf dist/ && babel ./ --out-dir dist/ --ignore ./node_modules,./.babelrc,./package.json,./npm-debug.log --copy-files --source-maps",
"start": "npm run build && node --inspect=12345 dist/app.js"
And I configured a launch
as follows:
"configurations": [
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "$workspaceFolder\dist\app.js",
"preLaunchTask": "npm: build"
]
Hope it helps someone!
add a comment |
up vote
0
down vote
accepted
I found out I was just missing the --source-maps
from my babel-cli
command... -.-
After adding it, VSCode is able to find the breakpoints.
So basically the solution was:
Add --source-maps
to my build command:
"scripts":
"build": "rimraf dist/ && babel ./ --out-dir dist/ --ignore ./node_modules,./.babelrc,./package.json,./npm-debug.log --copy-files --source-maps",
"start": "npm run build && node --inspect=12345 dist/app.js"
And I configured a launch
as follows:
"configurations": [
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "$workspaceFolder\dist\app.js",
"preLaunchTask": "npm: build"
]
Hope it helps someone!
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
I found out I was just missing the --source-maps
from my babel-cli
command... -.-
After adding it, VSCode is able to find the breakpoints.
So basically the solution was:
Add --source-maps
to my build command:
"scripts":
"build": "rimraf dist/ && babel ./ --out-dir dist/ --ignore ./node_modules,./.babelrc,./package.json,./npm-debug.log --copy-files --source-maps",
"start": "npm run build && node --inspect=12345 dist/app.js"
And I configured a launch
as follows:
"configurations": [
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "$workspaceFolder\dist\app.js",
"preLaunchTask": "npm: build"
]
Hope it helps someone!
I found out I was just missing the --source-maps
from my babel-cli
command... -.-
After adding it, VSCode is able to find the breakpoints.
So basically the solution was:
Add --source-maps
to my build command:
"scripts":
"build": "rimraf dist/ && babel ./ --out-dir dist/ --ignore ./node_modules,./.babelrc,./package.json,./npm-debug.log --copy-files --source-maps",
"start": "npm run build && node --inspect=12345 dist/app.js"
And I configured a launch
as follows:
"configurations": [
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "$workspaceFolder\dist\app.js",
"preLaunchTask": "npm: build"
]
Hope it helps someone!
answered Nov 10 at 17:05
João Menighin
1,23241939
1,23241939
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53239745%2fcant-get-vscode-debbuging-to-work-with-my-nodejs-app%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown