question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should be able to step through .js code when source fails to load

See original GitHub issue

Describe 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:

  1. 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)
  2. Set a breakpoint in your app on a call into that dependency
  3. Step into the call
  4. 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
connor4312commented, Sep 21, 2020

recording(4)

You can try this out in the next nightly build

1reaction
mgabeler-lee-6rscommented, Sep 11, 2020

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found