A
A
aarifkhamdi2019-08-31 19:02:04
JavaScript
aarifkhamdi, 2019-08-31 19:02:04

How to set up nodemon + ts-node debugging in VSCode?

In package.json after 1000 and 1 try I have:

"debug": "nodemon --watch 'src/**/*.ts' --exec node --inspect-brk -r ts-node/register src/server.ts",
"testdebug": "node --inspect-brk node_modules/.bin/jest --watchAll --runInBand"

launch.json:
{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "debug",
            "runtimeExecutable": "yarn",
            "console": "integratedTerminal",
            "internalConsoleOptions": "openOnSessionStart",
            "runtimeArgs": [
                "debug"
            ],
            "port": 9229
        },
        {
            "type": "node",
            "request": "launch",
            "name": "test debug",
            "runtimeExecutable": "yarn",
            "console": "integratedTerminal",
            "restart": true,
            "runtimeArgs": [
                "testdebug"
            ],
            "port": 9229
        }
    ]
}

The problem is that after pressing "stop" in the debugger, the console does not close. The application still hangs running.
Please share the correct config or explain what is wrong in my

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question