Inaccurate breakpoints in VS Code during debugging
See original GitHub issueDescribe 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:
- Created 3 years ago
- Reactions:2
- Comments:7 (3 by maintainers)
Top 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 >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
Could you try again with latest versions of
svelte
,svelte-preprocess
androllup-plugin-svelte
? This might work as expected now.🎉