RBCodeCraft / vscode-ts-node-debugging

Debugging Typescript in VS Code without compiling
174 stars 91 forks source link

Cannot debug test script #3

Closed borekb closed 7 years ago

borekb commented 7 years ago

I am on Node 8.4 and VSCode 1.16 as stated in the README. When I try to open person.tests.ts and invoke the 'Current TS Tests File' debug configuration, I get this error:

Cannot launch program 'c:\Temp\vscode-ts-node-debugging\node_modules.bin_mocha'; setting the 'outDir or outFiles' attribute might help.

I noticed that there's a backslash missing in the .bin_mocha part (should be .bin\_mocha) so maybe it's a Windows-only issue?

borekb commented 7 years ago

I tried changing the program to this in launch.json:

"program": "${workspaceRoot}/node_modules/mocha/bin/mocha"

This starts the debugging session but breakpoints are not hit because of the "Breakpoint ignored because generated code not found (source map problem?)" issue.

borekb commented 7 years ago

I actually removed all sourcemap-related config options in https://github.com/EnterpriseJSTutorial/vscode-ts-node-debugging/pull/4 and now it works. Go figure :)

dupski commented 7 years ago

Great stuff @borekb , its annoying this stuff is not documented very well eh! I'm going to make a couple of small tweaks to your PR then will merge it. Cheers! :)

borekb commented 7 years ago

Thanks, the tweaks in #5 make it even better :) BTW, I hope Mocha execution still works on Mac / Linux – it should but I had no way to test it.

Related to the original post, I've created a VSCode issue Node launch 'program' parsed incorrectly https://github.com/Microsoft/vscode/issues/34541.

dupski commented 7 years ago

Yep, tested it on Mac, works fine :)