2

With this setup I'm able to remote debug js files (on my Raspberry Pi). But I would like to break inside ts files just as I'm able to do while local debugging. Is this possible?

I tried with different param in launch.json but with no luck. sourceMaps and outFiles seem to have no effect.

launch.json

{
        "type": "node",
        "request": "attach",
        "name": "Attach to Remote",
        "address": "192.168.0.222",
        "port": 9229,
        "protocol": "inspector",
        "localRoot": "${workspaceFolder}/src",
        "remoteRoot": "/home/pi/BADGER/src",
        "outFiles": [
            "${workspaceFolder}/bin/**/*.js"
        ],
        "sourceMaps": true
}
1
  • I'm just verifying: Your IP is 192.168.0.222 and the port you're using for your node app is 9229. In other words - go to the node folder, run node index.js or whatever you use and enter http://192.168.0.222:9229 Verify you see it correctly. Commented Jan 7, 2018 at 14:58

1 Answer 1

1

Based on this article: Debugging TypeScript in VS Code without compiling, using ts-node

Again - given your node app runs on http://192.168.0.222:9229 (try to enter this path manually to verify)

Add this to launch.json

    {
        "name": "Attach",
        "type": "node",
        "request": "attach",
        "port": 9229,
        "address": "192.168.0.222",
        "restart": true,
        "sourceMaps": true,
        "outDir": "${workspaceRoot}",
        "localRoot": "${workspaceRoot}",
        "remoteRoot": "/home/pi/BADGER/src"
    }
Sign up to request clarification or add additional context in comments.

2 Comments

But how does this help me running it remotely (on a Raspberry Pi)?
Sadly the article did not provide info for my problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.