Skip to content
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

Handing of "[DEP0062] DeprecationWarning: node --inspect --debug-brk is deprecated. Please use node --inspect-brk instead" #44371

Closed
alanosman opened this issue Feb 25, 2018 · 8 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues under-discussion Issue is under discussion for relevance, priority, approach

Comments

@alanosman
Copy link

alanosman commented Feb 25, 2018

Hi team, I was reading through the closed issues on this deprecated warning but I still can't seem to get the message removed and am a little confused with exactly how it was resolved. I've followed (I think) the instructions for using the setting "protocol": "inspector" but I still it being launched with the deprecated parameter and see the message even though I have this setting.

By using "protocol": "inspector" is that supposed to issue the correct node debug command? In one of the discussions detailing this issue (here #32529), it was mentioned by @weinand that there is no way to remove this message because both debug parameters are submitted. But surely this protocol setting could be smart and only submit the parameters required for more modern versions of node? Also setting this parameter to auto fails and node will not start.

If you look at the command being issued it shows that node --inspect --debug-brk are the two parameters being passed. Node is asking for --inspect-brk. Maybe one other option would be to add a launch parameter to provide your own debug parameters should you desire.

Maybe I am doing something wrong, or maybe I am just late to the party and missed the solution, but I am still puzzled and have expired all of my searches on trying to resolve it. Please point me to the article that shows the solution if so.

I am using node 9.5.0 on WSL with the latest Visual Code production build 1.20.1. I also checked on the insiders build of VC and it's also there.

image

My launch.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "queue",
            "protocol": "inspector",
            "program": "${workspaceFolder}/queue.js",
            "useWSL": true,
            "outputCapture": "std",
            "sourceMaps": true
        },
    ]
}

Cheers.

@alanosman alanosman changed the title Suggestion for handing "[DEP0062] DeprecationWarning: node --inspect --debug-brk is deprecated. Please use node --inspect-brk instead" Hhanding "[DEP0062] DeprecationWarning: node --inspect --debug-brk is deprecated. Please use node --inspect-brk instead" Feb 25, 2018
@alanosman alanosman changed the title Hhanding "[DEP0062] DeprecationWarning: node --inspect --debug-brk is deprecated. Please use node --inspect-brk instead" Handing "[DEP0062] DeprecationWarning: node --inspect --debug-brk is deprecated. Please use node --inspect-brk instead" Feb 25, 2018
@alanosman alanosman changed the title Handing "[DEP0062] DeprecationWarning: node --inspect --debug-brk is deprecated. Please use node --inspect-brk instead" Handing of "[DEP0062] DeprecationWarning: node --inspect --debug-brk is deprecated. Please use node --inspect-brk instead" Feb 25, 2018
@weinand
Copy link
Contributor

weinand commented Feb 26, 2018

I cannot reproduce this problem on Windows with VS Code 1.20.1 and node.js v9.5.0:

2018-02-26 10-46-48

Please verify that the node.js running in WSL has the version you expect if to have.

@weinand weinand added debug Debug viewlet, configurations, breakpoints, adapter issues info-needed Issue requires more information from poster labels Feb 26, 2018
@alanosman
Copy link
Author

alanosman commented Feb 26, 2018

Hi @weinand - I still get the same message using my desktop with visual code. That is running a production build of Windows 10 with the latest creators update.

I did tried again, this time on my Surface book (different machine) which has Insiders build version of Windows 10 and Ubuntu 16. I get the same issue. I tried to force run a specific version of node within launch.json (as you can see below), but that still did not eliminate the message. I've also tried upgrading to node 9.6.1 and downgrading to node 7x, but still I see the message. I also tried the Visual Code insiders build, and still I see the message.

What's different about your environment? Could it be something related to your .bashrc?

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "protocol": "inspector",
            "request": "launch",
            "name": "Run Elastc",
            "program": "${workspaceFolder}/elastc.js",
            "useWSL": true,
            "outputCapture": "std",
            "sourceMaps": true,
            "runtimeExecutable": "/home/aosman/.nvm/versions/node/v9.6.1/bin/node"
        },
    ]
}

@alanosman
Copy link
Author

@weinand what other info can I get you?

@weinand
Copy link
Contributor

weinand commented Feb 26, 2018

instead of running "elastc.js" please just run the trivial program version.js:

console.log(process.version)

What is the output?

If you set "useWSL" to false what is the output?

@alanosman
Copy link
Author

alanosman commented Feb 26, 2018

@weinand here it is with a simple test:
image

If I set useWSL to false, nothing will work. I do not have node installed on Windows and my code is executing from within bash. If you really need to know I will go ahead and install it, but that really is outside the environment we are in.

@weinand
Copy link
Contributor

weinand commented Feb 26, 2018

So I cannot explain why you are seeing this but it is not really a problem at all. See this comment for why we are doing this:

It's not a bug, it's a valid way to put node 8 in debug mode, which they only kept to make life easier for IDEs. See nodejs/node#12949 and related issues. Also I have #27731 to make version detection more sophisticated in the future and try to use --inspect-brk.

@roblourens might chime in...

@weinand weinand assigned roblourens and unassigned weinand Feb 26, 2018
@weinand weinand added under-discussion Issue is under discussion for relevance, priority, approach and removed info-needed Issue requires more information from poster labels Feb 26, 2018
@alanosman
Copy link
Author

alanosman commented Feb 26, 2018

@weinand It can't be coincidence that it is happening in two different desktop environments. I even stripped my .bashrc back to barebones. The only thing I have in there is my nvm setting. Are you using nvm by any chance?

here's what I had in my .bashrc

export NVM_DIR="/home/aosman/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" 
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" 

I also did this test: just running node at the command line and did not see the same message.

aosman@falcon:~/elastc-app$ node --inspect=38071 --debug-brk test.js
Debugger listening on ws://127.0.0.1:38071/cb4889c2-7364-47f5-8116-64e02ae9583f
For help see https://nodejs.org/en/docs/inspector

Perhaps this may be related to running bash.exe from Windows land and then executing node?
image

@roblourens
Copy link
Member

I try to check the node version to determine whether it's safe to use --inspect-brk but I don't when there's a runtimeExecutable set (like for wsl). Soon I will switch the default to --inspect-brk. But in the meantime it's safe to ignore this message.

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

No branches or pull requests

3 participants