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

NodeBB + VSCode Debugging - Breakpoints not working #46160

Closed
reliasn opened this issue Mar 20, 2018 · 1 comment
Closed

NodeBB + VSCode Debugging - Breakpoints not working #46160

reliasn opened this issue Mar 20, 2018 · 1 comment
Assignees

Comments

@reliasn
Copy link

reliasn commented Mar 20, 2018

Version 1.20.1
Commit f88bbf9
Date 2018-02-13T15:34:36.336Z
Shell 1.7.9
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

NodeBB is a Node.js forum platform. To extend it, you can add plugins to its node_modules folder, for example, node_modules/nodebb-plugin-mychat.

When I place a breakpoint on NodeBB's app.js, it breaks fine. But if I place a breakpoint on my node_modules/nodebb-plugin-mychat/library.js, it doesn't work. I remember I had this issue in the past and that I had to mess with the launch.json file in order to get it working. I simply couldn't find the solution again so if someone could help me out on this, I'd appreciate it. This is my launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "program": "${workspaceRoot}\\app.js",
            "console": "integratedTerminal"
        }
    ]
}

Some console logs:

PS D:\Desktop\openshift\NodeBB> cd 'd:\Desktop\openshift\NodeBB'; & 'node' '--inspect-brk=4648' 'app.js'
Debugger listening on ws://127.0.0.1:4648/228491de-ee5a-4d9c-ab0b-218864a27f3f
For help see https://nodejs.org/en/docs/inspector
Debugger attached.
2018-03-20T06:53:37.550Z [561032] - info: NodeBB v1.8.0 Copyright (C) 2013-2018 NodeBB Inc.
@reliasn
Copy link
Author

reliasn commented Mar 20, 2018

I remembered what I had done. Fixed the issue with this.

Basically my NodeBB plugin is a junction symlink:

So I had to add the following to my launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "program": "${workspaceRoot}\\app.js",
            "console": "integratedTerminal",
            "runtimeArgs": [
                "--preserve-symlinks"
            ]
        }
    ]
}

Debugging works well now.

@reliasn reliasn closed this as completed Mar 20, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants