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

Why breakpoints not working? #80051

Closed
KhalitovAdel opened this issue Aug 29, 2019 · 5 comments
Closed

Why breakpoints not working? #80051

KhalitovAdel opened this issue Aug 29, 2019 · 5 comments
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues

Comments

@KhalitovAdel
Copy link

KhalitovAdel commented Aug 29, 2019

  • VSCode Version: 1.37.1
  • OS Version: Ubuntu 19.04

Steps to Reproduce:

  1. I create launch.json
{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch via NPM",
            "runtimeArgs": [
                "run-script",
                "debug"
            ],
            "port": 9229,
            "runtimeExecutable": "/home/adel/.nvm/versions/node/v8.12.0/bin/npm",
            "outFiles": ["${workspaceRoot}"],
        }
    ],
    "compounds": [
        {
            "name": "Compound",
            "configurations": []
        }
    ]
}
  1. After create script in package.json
    "debug": "unset NODE_ENV && export NODE_ENV=dev_ms && babel-node server.js | node_modules/.bin/bunyan",
    When i start breakpoints not working. Why its so hard?
@vscodebot
Copy link

vscodebot bot commented Aug 29, 2019

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@KhalitovAdel KhalitovAdel changed the title Who breakpoints not working? Why breakpoints not working? Aug 29, 2019
@weinand weinand added the debug Debug viewlet, configurations, breakpoints, adapter issues label Aug 29, 2019
@weinand
Copy link
Contributor

weinand commented Aug 29, 2019

Are you sure that "babel-node server.js" runs node.js in debug mode?

@weinand weinand added the info-needed Issue requires more information from poster label Aug 29, 2019
@KhalitovAdel
Copy link
Author

Are you sure that "babel-node server.js" runs node.js in debug mode?

Yes, I can see in console:

Debugger listening on ws://127.0.0.1:9229/92614092-563f-4c8b-a188-183e5dd45a95
For help see https://nodejs.org/en/docs/inspector

Now I changed launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Start",
            "runtimeExecutable": "/home/adel/.nvm/versions/node/v8.12.0/bin/npm",
            "runtimeArgs": [
                "run",
                "debug",
            ],
            "cwd": "${workspaceFolder}",
        },
        {
            "type": "node",
            "request": "attach",
            "name": "Listen",
        },
        {
            "name": "Do it",
            "configurations": ["Start", "Listen"], 
        }
    ],
}

When i start "Do it", appears window when i can choose Node.js, after that nothing happens! Why?

@KhalitovAdel
Copy link
Author

https://code.visualstudio.com/docs/editor/debugging#_compound-launch-configurations

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Start",
            "runtimeExecutable": "/home/adel/.nvm/versions/node/v8.12.0/bin/npm",
            "runtimeArgs": [
                "run",
                "debug",
            ],
            "cwd": "${workspaceFolder}",
            "port": 9229
        },
        {
            "type": "node",
            "request": "attach",
            "name": "Listen",
        },
        
    ],
    "compounds": [
        {
            "name": "Do it",
            "configurations": ["Start", "Listen"],
        }
    ]
}

Thanks, I fixed all problems by this code

@weinand
Copy link
Contributor

weinand commented Sep 3, 2019

Thanks!

@weinand weinand closed this as completed Sep 3, 2019
@weinand weinand removed the info-needed Issue requires more information from poster label Sep 3, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 18, 2019
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

2 participants