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

I am not able to debug via VS code #671

Closed
kirill-kostenetskyi opened this issue Aug 21, 2018 · 1 comment
Closed

I am not able to debug via VS code #671

kirill-kostenetskyi opened this issue Aug 21, 2018 · 1 comment

Comments

@kirill-kostenetskyi
Copy link

kirill-kostenetskyi commented Aug 21, 2018

Hi there,
Could somebody let me know what is my problem ? I've read thread with the same problem but nothing help me.
This is how my launch.json configuration looks:

{
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "runtimeArgs": [
                "-r",
                "ts-node/register"
            ],
            "args": [
                "${workspaceFolder}\\src\\index.ts"
            ]
        }

While I pressing "Launch Program" I saw in the console:

C:\Program Files\nodejs\node.exe -r ts-node/register --inspect-brk=19234 C:\Projects\helloworld-ts22222\src\index.ts 
Debugger listening on ws://127.0.0.1:19234/1728a553-61fd-40b8-a028-d947ebab9ddb
Debugger attached.
Waiting for the debugger to disconnect...

What am I do wrong ?

I am able to run my project with npm run dev command. This is how my package.json looks:

{
  "name": "helloworld-ts22222",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "build": "tsc",
    "dev": "ts-node ./src/server.ts",        
    "debug": "ts-node --inspect ./src/server.ts",        
    "start": "nodemon ./src/server.js",
    "prod": "npm run build && npm run start"
},
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "ts-node": "^7.0.1",
    "typescript": "^3.0.1"
  },
  "dependencies": {
    "body-parser": "^1.18.3",
    "express": "^4.16.3"
  }
}

I am pretty sure I am missing something, I just started with TypeScript

@kirill-kostenetskyi
Copy link
Author

Oh, that was a typo because of my inattention.
The correct launch config is:

{
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "runtimeArgs": [
                "-r",
                "ts-node/register"
            ],
            "args": [
                "${workspaceFolder}\\src\\server.ts"
            ]
        },

I need to put server.ts instead index.ts due to specific project structure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant