Vscode-js-debug: Unbound remote ts breakpoint

Created on 15 Sep 2020  路  5Comments  路  Source: microsoft/vscode-js-debug

Describe the bug
I run a typescript node app in a local docker container and attach to it for debugging.
Breakpoints are always unbound now under the new debugger, however they still get hit and open up the transpiled js file instead.

My config:

{
      "type": "node",
      "request": "attach",
      "name": "Docker Attach",
      "address": "0.0.0.0",
      "port": 9995,
      "localRoot": "${workspaceFolder}",
      "remoteRoot": "/app",
      "outFiles": [
        "${workspaceFolder}/build/**/*.js"
      ],
      "skipFiles": [
        "<node_internals>/**/*.js",
      ]
}

Docker container ties ${workspaceFolder}/build and /app/build together as a volume mount. Same with ${workspaceFolder}/src and /app/src. So I can edit and hot reload with Nodemon.

App is started via node --inspect=0.0.0.0:9995 build/src/index.js

Log File

vscode-debugadapter-1.json.gz

VS Code Version:
Version: 1.49.0
Commit: e790b931385d72cf5669fcefc51cdf65990efa5d
Date: 2020-09-10T17:39:53.251Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Darwin x64 19.5.0

bug candidate

Most helpful comment

Ok, thanks for confirming, I'll put a fix in for the next release.

All 5 comments

What happens if you set resolveSourceMapLocations: null? (You'll need to set the type: 'pwa-node' for this to appear as valid)

Hey yeah that makes it work again!

Ok, thanks for confirming, I'll put a fix in for the next release.

Same problem here, but the fix works for me to :+1:

Verification steps -- running the non-nightly js-debug 1.48.8 build:

  1. "Try a sample" and use the Node container
  2. yarn add typescript
  3. Create test.ts containing

    setInterval(() => {
      console.log('test')
    }, 1000);
    
  4. yarn tsc test.ts --sourceMap

  5. Run node --inspect=19229 test.js, and make sure that port is forwarded locally
  6. In a local folder in another window, repeat steps 2-4
  7. Create a launch.json in the local folder

    {
      "version": "0.2.0",
      "configurations": [
        {
          "name": "Attach to remote",
          "type": "pwa-node",
          "request": "attach",
          "localRoot": "${workspaceFolder}",
          "remoteRoot": "/workspaces/vscode-remote-try-node",
          "port": 19229,
        }
      ]
    }
    
  8. Set a breakpoint on line 2 and run the config. Verify that the breakpoint is hit in test.ts

Was this page helpful?
0 / 5 - 0 ratings