TypeScript dependency breakpoints not hit when using JavaScript Debug Terminal
See original GitHub issueDescribe the bug
I have a typescript library which I’m publishing with sourcemaps, but breakpoints in the .ts
files are not hit when invoked from the JavaScript Debug Terminal.
To Reproduce
I’ve created a stand-alone repo here: https://github.com/icholy/typescript_breakpoint_bug
npm i
.- Open vscode and set breakpoint at
node_modules/@icholy/no-ts-breakpoint-bug/src/index.ts:3
. - Open Javascript Debug Terminal and run
node main.js
.
Log File: Not sure how to do this with the JavaScript Debug Terminal.
VS Code Version: 1.71.2
Additional Notes:
- If you
npm link
the package, the breakpoints work. - If you use a launch config, the breakpoints work.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Visual Studio code breakpoint not working on Node.js using ...
1 Answer 1 · Add the start script to package.json · click on the debug menu icon on the left side navigation menu....
Read more >How to Debug Typescript and Hit Breakpoints | 2018 - YouTube
Using Webpack and Source maps we can debug Typescript TS code by setting ... Typescript file even though it's the compiled Javascript JS...
Read more >Debug Node.js Apps using Visual Studio Code
The Visual Studio Code editor includes Node.js debugging support. Set breakpoints, step-in, inspect variables and more.
Read more >TypeScript Debugging Inside VSCode
In order to do that we need to have mappers, that map our TS files to the JS ones, and using those mappers...
Read more >How to debug TypeScript with VS Code - Philipp Kief - Medium
Now you can open the debug view (Ctrl-Shift-D) of VS Code. By clicking to the left of a line number you can add...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve pushed my workspace configuration to the linked repo.
Yep, you can also set the
debug.javascript.terminalOptions
in your user or workspace settings.Your case is having a breakpoint at
node_modules/@icholy/no-ts-breakpoint-bug/src/index.ts:3
. Because it’s innode_modules
, this is excluded by default. Note that you probably want to only add node modules you want to set breakpoints in rather than removing the!**/node_modules/**
negation entirely, for performance reasons.