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

--debug is deprecated #21883

Closed
ruskakimov opened this issue Mar 3, 2017 · 19 comments
Closed

--debug is deprecated #21883

ruskakimov opened this issue Mar 3, 2017 · 19 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues

Comments

@ruskakimov
Copy link

Console output on debugging:
DeprecationWarning: node --debug is deprecated. Please use node --inspect instead.

  • VSCode Version: 1.10.1
  • OS Version: 10.11.6

Steps to Reproduce:

  1. Set breakpoint
  2. Start debugging
@weinand weinand self-assigned this Mar 3, 2017
@weinand
Copy link
Contributor

weinand commented Mar 3, 2017

@ruskakimov what node version are you using?

@ruskakimov
Copy link
Author

@weinand v7.7.1

@weinand
Copy link
Contributor

weinand commented Mar 3, 2017

The deprecation message is correct and produced by that version of node.
Please read the following section of the VS Code 1.10.1 release notes: https://code.visualstudio.com/updates/v1_10#_node2-transitioning

(In short: add a "protocol": "inspector" or "protocol": "auto" to your launch configuration).

@weinand weinand closed this as completed Mar 3, 2017
@weinand weinand added the debug Debug viewlet, configurations, breakpoints, adapter issues label Mar 3, 2017
@ghost
Copy link

ghost commented Mar 4, 2017

I am still seeing this deprecation message even after using

  "type":"node",
  "protocol": "inspector",

in my launch.json. This is also with VS Code 1.10.1 and Node.js 7.7.1 on macOS. Am I missing something? The suggested fix doesn't change anything.

@ruskakimov
Copy link
Author

ruskakimov commented Mar 4, 2017

@steve-p-com Did you add it to the existing config for program launch?
Like this one:

        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "program": "${file}",
            "cwd": "${workspaceRoot}",
            "protocol": "auto"
        }

This works for me. But adds an experimental feature warning 🤣.

@ghost
Copy link

ghost commented Mar 4, 2017

Yes. Because it was a new project today I just added protocol to the default launch.json, actually like this:

{
  "type": "node",
  "protocol": "inspector",
  "request": "launch",
  "name": "Launch Program",
  "program": "${workspaceRoot}/index.js"
},

but the result should be the much same I guess.

When I changed launch.json, it initially continued to produce the deprecation warning. Now though, it is behaving as expected. What is more puzzling is that if I remove the protocol property again, so it looks like this:

{
  "type": "node",
  "request": "launch",
  "name": "Launch Program",
  "program": "${workspaceRoot}/index.js"
},

it doesn't revert to producing the deprecation warning, even though it seems like it should. That seems weird.

@ghost
Copy link

ghost commented Mar 4, 2017

Never mind, I've figured out what's going on. There is an unexpected (to me) difference in behaviour between start and restart debugger commands. Unless you stop the debugging session completely and use start again, it doesn't pick up any changes in launch.json. I was under the impression that restart was just shorthand for stop followed by start, but evidently it is not.

@AdamCoulterOz
Copy link

@ruskakimov funny that, you wouldn't think running the latest release versions of code and node would have only "depreciated" or "experimental" debug options.

@weinand
Copy link
Contributor

weinand commented Mar 5, 2017

VS Code 1.10.x does no longer use the term "experimental" (and it never used the "deprecated" for a node version).

It it node that produces these "deprecated" or "experimental" messages without providing some "normal" option:

node --debug
(node:64180) DeprecationWarning: node --debug is deprecated. Please use node --inspect instead.

and

node --inspect
Warning: This is an experimental feature and could change at any time.

@ugate
Copy link

ugate commented Mar 9, 2017

@weinand It doesn't look like setting protocol to inspector or auto works when using compounds. If I run the following DEV it uses inspector, but if I run DEV/Chrome it uses legacy for DEV.

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "DEV",
      "type": "node",
      "request": "launch",
      "protocol": "inspector",
      "program": "${workspaceRoot}/index.js",
      "stopOnEntry": false,
      "args": [
        "dev"
      ]
    },
    {
      "name": "Chrome",
      "type": "chrome",
      "request": "launch",
      "url": "http://localhost:8080",
      "webRoot": "${workspaceRoot}/public",
      "userDataDir": "${env:TEMP}/VSCodeChrome/${workspaceRootFolderName}"
    }
  ],
  "compounds": [
    {
      "name": "DEV/Chrome",
      "configurations": [
        "DEV",
        "Chrome"
      ]
    }
  ]
}

Also, even when running just DEV by itself it executes node --inspect=12680 --debug-brk index.js dev instead of the expected node --inspect=12680 --inspect-brk index.js dev.

@weinand
Copy link
Contributor

weinand commented Mar 9, 2017

@ugate good find, but unrelated to this issue. Please create a new issue.

/cc @isidorn

@mortalBibo
Copy link

@ksix @ruskakimov @weinand @steve-p-com @ugate
how to sweep away this warning?
Warning: This is an experimental feature and could change at any time.

@weinand
Copy link
Contributor

weinand commented Apr 21, 2017

@bb-bibo the warning message is produced by node.js when using the '--inspect' flag.
Please ask on the node.js repository for how to get rid of this warning.
VS Code has no control over this.

@mortalBibo
Copy link

@weinand Thank you for solving my problem!love u~

@Gappa88
Copy link

Gappa88 commented Jun 7, 2017

@weinand I'm running Visual Studio Code v1.12.2 and NodeJs v8.0.0.
I tryed to enable the inspector mode in launch.json because I need to debug big arrays but I still get DeprecationWarning: node --inspect --debug-brk is deprecated. Please use node --inspect-brk instead, and I cannot debug because Visual Studio Code freezes. Where do I do it wrong?

launch.json
{
      "type": "node",
      "request": "launch",
      "name": "Launch Program",
      "program": "${workspaceRoot}\\server\\server.js",
      "protocol": "inspector"
    }

Thanks

@weinand
Copy link
Contributor

weinand commented Jun 7, 2017

@Gappa88 the launch config is correct and you can safely ignore the "--debug-brk" deprecation warning.

Without more information I have no clue why VS Code freezes. Which OS? Is this reproducible? When and how does VS Code freeze?

/cc @roblourens

@Gappa88
Copy link

Gappa88 commented Jun 7, 2017

@weinand
It seems to work correctly now after I have restarted Visual Studio Code. When I go to inspect an array of 80000 elements it stucks for a while but after that I can slide the array nicely!

Thank you very much

@rsmolkin
Copy link

rsmolkin commented Aug 31, 2017

I also get the deprecation warning. Node 8.4.

{
      "name": "Jest Tests",
      "type": "node",
      "request": "launch",
      "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/react-scripts",
      "runtimeArgs": [
        "--inspect-brk",
        "test"
      ],
      "args": [
        "--runInBand",
        "--no-cache",
        "--env=jsdom"
      ],
      "cwd": "${workspaceRoot}",
      "protocol": "inspector",
      "console": "integratedTerminal",
      "internalConsoleOptions": "neverOpen"
    }

@weinand weinand removed their assignment Aug 31, 2017
@roblourens
Copy link
Member

Still expected, tracking in #27731

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
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
Projects
None yet
Development

No branches or pull requests

8 participants