Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Debugging is not stable. (VsCode, Cmder) #77

Closed
alanaasmaa opened this issue Nov 19, 2017 · 3 comments
Closed

Debugging is not stable. (VsCode, Cmder) #77

alanaasmaa opened this issue Nov 19, 2017 · 3 comments

Comments

@alanaasmaa
Copy link

Hello,

Im using vscode to debug nodejs.
My app crashes often and sometimes stops watching files.

I run npm run dev-debug that calls adonis serve --dev --debug in cmder.
Debugging starts and all is fine.

I attach my vscode with this config

       {
            "name": "Attach",
            "type": "node",
            "request": "attach",
            "port": 9229,
            "address": "localhost",
            "restart": true,
            "sourceMaps": false,
            "localRoot": "${workspaceRoot}",
            "remoteRoot": null
        }

Everything works okey, except app is crashing pretty often and watch stops watching.

I use adonuxt template

@thetutlage
Copy link
Member

I am not sure how exactly Vscode debugger works, but adonis serve --debug is the command that starts the debugger to be used with Chrome devtools.

After doing a quick google search I believe you need to do following.

  1. Inside .vscode/launch.json file, set program: ${workspaceFolder}/server.js
  2. Do not start the server using adonis serve, since Vscode will start it for you once it will require the server.js file.

@alanaasmaa
Copy link
Author

alanaasmaa commented Nov 21, 2017

I don't remember excaxtly but i had some problems also when i launched the server from VsCode so i prefer to attach.

I will try to run server via vscode again, maybe i can recall what the problem was.

Here is my full vscode and im using the attach method.

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch",
            "type": "node",
            "request": "launch",
            "program": "${workspaceRoot}/server.js",
            "stopOnEntry": false,
            "args": [],
            "cwd": "${workspaceRoot}",
            "preLaunchTask": null,
            "runtimeExecutable": null,
            "runtimeArgs": [
                "--nolazy",
                "--harmony"
            ],
            "env": {
                "NODE_ENV": "development"
            },
            "console": "internalConsole",
            "sourceMaps": false
        },
        {
            "name": "Attach",
            "type": "node",
            "request": "attach",
            "port": 9229,
            "address": "localhost",
            "restart": true,
            "sourceMaps": false,
            "localRoot": "${workspaceRoot}",
            "remoteRoot": null
        },
        {
            "name": "Attach to Process",
            "type": "node",
            "request": "attach",
            "processId": "${command:PickProcess}",
            "port": 9229,
            "sourceMaps": false
        }
    ]
}

@thetutlage
Copy link
Member

The issue is not actionable. If you want you can ask for more help on forum, since there are bunch of Vscode users using Adonis https://forum.adonisjs.com/

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