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.

Inaccurate breakpoints in VS Code during debugging

See original GitHub issue

Describe the bug Breakpoints are inaccurate in VS Code. Sometimes they take you to transpiled code by Svelte/TypeScript. Other times they take you just after the breakpoint line. They also may not be hit at all. It seems related to source mapping.

To Reproduce Here is a repro link

Try setting breakpoints at lines 4 to 9 in App.svelte.

Expected behavior A breakpoint should be consistently hit just before the line is executed anywhere in the script parts of svelte files.

Information about your Svelte project:

System:
    OS: macOS 11.1
    CPU: (4) x64 Intel(R) Core(TM) i7-4558U CPU @ 2.80GHz
    Memory: 6.70 GB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 15.5.0 - /usr/local/bin/node
    yarn: 1.22.10 - /usr/local/bin/yarn
  Browsers:
    Chrome: 87.0.4280.88
    Firefox: 83.0
    Safari: 14.0.2
  npmPackages:
    rollup: ^2.35.1 => 2.35.1 
    svelte: ^3.31.1 => 3.31.1
  IDE: VS Code Insider v1.53.0-insider (with Svelte for VS Code v102.8.0) and also JetBrains Rider 2020.3

Severity It is annoying not being able to debug and affects productivity.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
dummdidummcommented, Jan 26, 2021

Could you try again with latest versions of svelte, svelte-preprocess and rollup-plugin-svelte? This might work as expected now.

0reactions
dummdidummcommented, Jan 27, 2021

🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging in Visual Studio Code
One of the great things in Visual Studio Code is debugging support. Set breakpoints, step-in, inspect variables and more.
Read more >
VS Code debugger is inconsistent while hitting breakpoints
The debugger is attached, but when I start adding breakpoints, some of them work properly (the dot indicating the breakpoint is red and...
Read more >
Troubleshoot Breakpoints in the Visual Studio Debugger
If you're debugging optimized code, make sure the function where your breakpoint is set isn't being inlined into another function. The Debugger.
Read more >
Debugging - vscode-docs
Breakpoints. Breakpoints can be toggled by clicking on the editor margin. Finer breakpoint control (enable/disable/reapply) can be done in the Debug view's ...
Read more >
Error Debugging in C++ with VS Code - Rollbar
By using breakpoints and stepping, we move slowly through the code and monitor the values stored in memory, the call stack, and other...
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