Should be able to step through .js code when source fails to load
See original GitHub issueDescribe the bug
If loading the source from the source map fails, it should be possible to step through the underlying .js
code. Instead I’m given an unhelpful window that just says something like
Could not load source '/yadda/yadda/node_modules/yadda/foo.ts': Unable to retrieve source content.
To Reproduce Steps to reproduce the behavior:
- Make an app/script that uses a package dependency, where that dependency has source maps, but no source code to go with them (e.g. no embedded source in the source map, and delete any corresponding .ts files from the installed dependency in node_modules)
- Set a breakpoint in your app on a call into that dependency
- Step into the call
- Desired: Have some way to see the
.js
code at least and step through it. Actual: Just get to see the error message and no code.
VS Code Version: 1.49.0
Additional context I used to be able to work around this by turning off the “new” debugger, as the “old” one didn’t have this problem. But with 1.49.0, it seems the legacy debugger is gone, or at least all the settings to choose it are gone AFAICT?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:13 (9 by maintainers)
Top Results From Across the Web
Handling common JavaScript problems - MDN Web Docs
Incorrectly using functions inside loops that iterate with a global variable (more generally "getting the scope wrong"). For example, in bad-for ...
Read more >Using Chrome JavaScript Debugger / How to break on page ...
In Chrome's Developer Tools, go to the Sources tab. On the right, open up Event Listener Breakpoints, and you can set breakpoints on...
Read more >"Could not load source" error when attempting to use ... - GitHub
Build the project ( npx tsc -p . ) ... Then, my program starts, the debugger attaches, and execution stops at any breakpoints...
Read more >Lesson 2: Javascript Errors and Debugging
Typos are a common source of bugs in JavaScript. If your script isn't working, check the following:
Read more >Debugging in JavaScript: Reading Console Errors
Whenever we are running JavaScript in the browser and something isn't working correctly, the first step is always to open the DevTools console....
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
You can try this out in the next nightly build
My dependency trees commonly have over 1500 packages, so … that is not a reasonable way to do it, esp. if that’s per launch config (of which I think I have hundreds across the dozens of repos I have in my workspace).