microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.25k stars 29.3k forks source link

Debugging with ts-node in WSL: Breakpoints set but not yet bound #40813

Closed rhyek closed 6 years ago

rhyek commented 6 years ago
Extension Author (truncated) Version
vscode-eslint dba 1.4.3
githistory don 0.2.3
gitlens eam 7.1.0
tslint eg2 1.0.24
php-debug fel 1.12.1
php-intellisense fel 2.2.2
flow-for-vscode flo 0.7.3
auto-close-tag for 0.5.5
auto-rename-tag for 0.0.15
vscode-styled-components jpo 0.0.10
csharp ms- 1.13.1
debugger-for-chrome msj 4.0.0
vetur oct 0.11.5
twospacefourspace Ohm 0.2.1
vscode-docker Pet 0.0.22
material-icon-theme PKi 3.2.0
ejs-language-support Qas 0.0.1
code-settings-sync Sha 2.8.7
html5-boilerplate sid 1.0.1
indenticator Sir 0.4.2
Align ste 0.2.0
html-preview-vscode tht 0.1.1

(3 theme extensions excluded)


Steps to Reproduce:

  1. Run a TypeScript program inside WSL with ./node_modules/.bin/ts-node --inspect=3001 --project ./src/server ./src/server/index.ts
  2. Run the following launch configuration:
    {
    "version": "0.2.0",
    "configurations": [
    {
      "type": "node",
      "request": "attach",
      "name": "Attach",
      "port": 3001,
      "restart": true,
      "protocol": "inspector",
      "localRoot": "${workspaceFolder}",
      "remoteRoot": "/mnt/c/Users/Carlos/Dev/personal/boilerplates/express-react"
    }
    ]
    }
  3. Any breakpoints in my .ts files are greyed out and have the tooltip "Breakpoints set but not yet bound".

If I run the same command from Windows command prompt and run the same debug configuration without localRoot and remoteRoot I can hit breakpoints perfectly.

I also notice that when run from Windows, I have some output of my program in the Debug Console stating the file's origin as file:///c%3A/Users/Carlos/Dev/personal/boilerplates/express-react/src/server/index.ts while when run from WSL it's debug:/mnt/c/Users/Carlos/Dev/personal/boilerplates/express-react/src/server/index.ts?session%3D6747a367-f75f-4749-8249-57bc7bf64603%26ref%3D1001. Not sure if that's relevant.

rhyek commented 6 years ago

I adding the following launch configuration:

    {
      "type": "node",
      "request": "launch",
      "name": "Launch",
      "runtimeExecutable": "yarn",
      "runtimeArgs": [
        "dev"
      ],
      "port": 3001,
      "useWSL": true
    }

Where yarn dev is nodemon --inspect=3001 --watch src/server --ext ts --exec ./node_modules/.bin/ts-node --project ./src/server ./src/server/index.ts and I get the same issue with the breakpoints.

KellyBennett commented 6 years ago

Any updates on this? I'm experiencing the same problem.

RDeluxe commented 6 years ago

Same problem here, with my code running in a docker container

hjnp commented 6 years ago

same problem, with node v8.10 + nodemon + typescript

stevenzeck commented 6 years ago

If you have your testing framework setup to collect coverage, that could be the problem. Try turning off coverage while debugging.

rhyek commented 6 years ago

Haven't encountered this again.