Yotam
Yotam

Reputation: 333

Visual Studio Code unbound breakpoint Node JS React TypeScript

When I try to put a breakpoint and start debugging, the breakpoint becomes hollow and unbound.

Does someone know how to fix this problem? I've already looked around and tried and nothing helped so far...

I'm using VSCODE NODEJS REACT TYPESCRIPT

launch.json

launch.json

tsconfig.json

tsconfig.json

Upvotes: 21

Views: 33241

Answers (3)

Alexander Khomenko
Alexander Khomenko

Reputation: 597

Well, I just had the same problem on an open source project. I tried several things, like updating the VSCode, "sourceMap" was already true, but nothing helped.

Then I realised that there were discrepancies in launch.json: While the whole project was working on the "dist" directory, launch.json was working on "out".

enter image description here

Now it works as expected. Of course I will create a pull request.

Upvotes: 1

Baga
Baga

Reputation: 1442

Setting sourceMap to true in tsConfig.json solved the issue.

{
  "compilerOptions": {
    ...
    "sourceMap": true
    ...
  }
}

Upvotes: 7

Yotam
Yotam

Reputation: 333

Solved it by opening the terminal first, "npm start" then pressing F5 to start debugging.

Upvotes: 7

Related Questions