microsoft / vscode-edge-debug2

This is a VS Code extension which helps you debug your JavaScript Code inside the Edge browser.
Other
37 stars 31 forks source link

Not hitting breakpoints when building with webpack #174

Open TCourtneyOwen opened 4 years ago

TCourtneyOwen commented 4 years ago

I am having problems hitting breakpoints when building with webpack. To be precise, I am hitting breakpoints but not in the right location - breakpoints seem to be off by a few lines. If I build with tsc, however, I hit breakpoints fine. I see the following in your issues preamble:

Breakpoints not working? The README has some tips. Please see the "Troubleshooting" section of the README before filing an issue. Especially the tip about using the .scripts command for debugging sourcemap issues. I actually don't see anything about .scripts in the ReadMe to assist in debugging sourcemap issues. Can you please clarify what I should do or where to find the information for using .scripts?

Thanks,

Courtney

HQ92 commented 4 years ago

I have a similar issue where I can set a breakpoint and it will get successfully hit the first time I reload the page. But then the line number for the breakpoint in the panel will change to a line that does not exist within the file once it has been hit. Clicking the button to disable and enable all breakpoints again then seems to push vs code into displaying the breakpoints in the correct places again for some reason?

The browser devtools seem to navigate and use the sourcemaps correctly but vs code tries to show me the actual files on the disk but is going wrong slightly somewhere?

I've attached my scripts file as follows but cannot see any issue with mappings between the debugger and my files on the hard disk?

scripts.txt

@TCourtneyOwen If you navigate to the Debug Console panel whilst VS Code debugger is attached to your running application and then run the command '.scripts'. The console window should print information on how it is mapping your files as requests come in, I just ran the command and then clicked around a little and then right clicked on the console window and clicked Copy all. Put that in a file and voila.

HQ92 commented 4 years ago

The issue seems very similar to the one on the chrome vscode debugger github page as well https://github.com/microsoft/vscode-chrome-debug/issues/950