-
Notifications
You must be signed in to change notification settings - Fork 29.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breakpoint jumps due to line breaks #51698
Comments
I can't repro this in a Jest project I have. Can you share your project? Are you sure that there are no sourcemaps or transpilation step involved? Have you debugged this with Chrome devtools? |
Hi @roblourens, thanks for the quick feedback. I went ahead and created a dummy project to demo: Regards, |
@corey-aloia-sap I also had this issue but it got resolved when i put "sourceMaps": false, in configuration. Just try and see if it helps you. |
@sysleaf yes, this stops it from jumping, thanks! I had been removing the line breaks, but knowing this is super helpful! |
I really thought I replied to this already, but I guess not, sorry. I tried the test project earlier and saw that the file at runtime was transpiled or transformed and linebreaks were removed. Sourcemaps should cover this but they were incorrect or missing. |
@roblourens I just had a look at the vscode documentation, and it sounds like in this case the breakpoints should be showing up as gray and not hitting, but in my case they are red:
Or am I misinterpreting this? Thanks! |
On second thought, this is a bug. There's still something wrong with this case when the generated file has the same name as the source file. |
@roblourens setting sourceMaps to false did not fully resolve this as I had initially said. Instead, it lead to it jumping under other scenarios. I.E. it fixed the one test case I presented in my demo project, but I have since run into more. I have added two more demo scenarios that can be viewed in the readme. Maybe this is a problem with the way Node is interacting with files that have line breaks and empty spaces. Either way, something doesn't seem right. Thanks again! |
I wouldn't expect that to fix it. That option just tells the adapter to ignore the sourcemaps which is definitely not the right thing to do. |
Merging this into #60187 as I believe it's the same bug |
Steps to Reproduce:
I have tested the above multiple times on 2 different macs, and you can count the line breaks and predict where the breakpoint will jump to. When I say jump, the actual line number for the breakpoint will increase. I.E. a breakpoint at myfile:37 will increase every time you click on debug by the amount of line breaks present in the file before the breakpoint.
Let me know if anymore information is needed!
Here is my launch config:
There is no Babel or Typescript.
Vs Code is awesome by the way!
Regards,
Corey
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: