-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debugger and runTimeArgs order #16173
Comments
@danielepolencic you can avoid that VS Code passes a And please use This should work: {
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceRoot}/index.ts",
"cwd": "${workspaceRoot}",
"outFiles": [ "${workspaceRoot}/bin/**/*.js" ],
"sourceMaps": true,
"env": {
"NODE_ENV": "development"
},
"port": 35420,
"runtimeExecutable": "docker",
"runtimeArgs": ["run", "-ti", "node:6.9.1", "--debug-brk=35420" ]
}
]
} |
@weinand, sorry for commenting on an old issue, but I just ran into a similar problem while trying to get VS Code to collaborate with nvm, and I've come to believe that this issue shouldn't have been closed. I got it to work using your workaround: {
"version": "0.2.0",
"configurations": [
{
"protocol": "inspector",
"type": "node",
"request": "launch",
"name": "Mocha Tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
// Hardwire the port to prevent VS from injecting --inspect-brk=... before the runtimeArgs:
// https://github.com/Microsoft/vscode/issues/16173#issuecomment-263496120
"port": 49534,
"args": [
"-u", "tdd",
"--timeout", "999999",
// ...
"tests/**/*.js"
],
"internalConsoleOptions": "openOnSessionStart",
"runtimeExecutable": "${env:NVM_DIR}/nvm-exec",
"runtimeArgs": [
"node",
"--inspect-brk=49534" // Has to match the "port" config above
]
}
]
} It would have been nicer if I could just have omitted the
... the problem being that It seems unintuitive that Code would inject that before the |
@papandreou Wouldn't you setting your default Node version via NVM solve things and simplify the configuration? https://eric.blog/2016/08/23/set-default-node-version-with-nvm/ |
Hey @auchenberg, long time no see :). I have specified the Because of that, it’s practical to have local As another example, Travis supports |
@roblourens For the legacy protocol I'm now adding the |
Done! |
Wow, thanks, guys :) |
Verification: |
I don't have nodejs installed locally on my machine, but I'm using the official docker image to run the typescript. I tried to setup VS Code to launch the docker image but the
--debug-brk
flag is injected before any of the arguments. Is there any way I could control the order of the arguments?Steps to Reproduce:
launch.json
:The console prints:
docker --debug-brk=35420 run -ti node:6.9.1 bin/index.js flag provided but not defined: --debug-brk See 'docker --help'.
To run the application in docker that line should read instead:
The text was updated successfully, but these errors were encountered: