none
Javascript debugger is acting up. How to fix? RRS feed

  • Question

  • Hi there

    Ways back something happened to my MS VS 2019 and it is now impossible to use the JavaScript debugger. If I place the

    debugger;

    operator in my JS code, the Studio stops but it shows a very top of a lump of the code with no breakpoint visible, no debugging context and no way to step over. It looks like it recognizes the debugger; operator but pick up a random lump of code to show.

    How to fix it?

    Thanks.

    Tuesday, August 20, 2019 2:12 PM

All replies

  • Hi Renziglov,

    Welcome to MSDN forum.

    Based on your description, did you debug JS code with cshtm or vbhtml files? If so, please check if the option "Enable JavaScript debugging for ASP.NET(Chrome,Edge, IE)" is enabled in Options/Debuging/General.

    If yes, please try to follow these two methods from below DOC to debug your JS code:

    Debug JavaScript in dynamic files using Razor (ASP.NET)

    Any feedback will be expected.

    Best Regards,

    Dylan




    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Wednesday, August 21, 2019 2:49 AM
  • Hi Dylan

    1. Of course, "Enable JavaScript debugging" is ON and it was never be OFF

    2. The link is very useful but irrelevant to my case. I do not debug the dynamic page.

    My page is static cshtml file. It has the debugger; operator in it. when I start, it STOPS, but in the top of the code which does not have the code line with my debugger; and when hit F10 to step over, it proceeds with the code which does not relate cshtml.

    What I did:

    1. Clear Solution. No effect

    2. Clear Browser cache. No effect

    3. Tried the same debugging session with the same code in different Visual Studio 2015, 2017, 2019. No effect

    Thoughts?

    Wednesday, August 21, 2019 12:56 PM
  • Hi Renziglov,

    Thank you for reply.

    As far as I know, I am afraid the debugger could not debug the JS code which is in cshtml. We recommend you could detach the js code to js file, then debug them

    BTW, you could also move to developer community to report this issue to product team and post the link here, then I will help you to vote it and if other members who are interested it also vote it.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Thursday, August 22, 2019 8:45 AM