❔ Advice on Blazor+TypeScript debugging in Visual Studio
Hey there, I'm working on a Blazor Server app in Visual Studio. I've followed some guides on adding TypeScript, and got the compiler integration working with code isolation. That is to say, my Index.razor.ts gets processed into a Index.razor.js + source map. I can import the code into my component and call it just fine.
My question is about debugging this TS/JS. I read and tried to follow the MS guide here https://learn.microsoft.com/en-us/visualstudio/javascript/debug-nodejs?view=vs-2022, but the only breakpoints that are being hit are when I go into my browser dev tools, then set a breakpoint on the JS from within the browser. Visual Studio will notice that, and I can inspect objects at the breakpoint from either the browser or a temporal tab that shows up in VS. Breakpoints that I set in the TS or JS within Visual Studio directly are not being hit.
I feel like / imagined that I could set a breakpoint on the TS in Visual Studio, and deal with it from there -- is that just not how it works? I understand that the browser will be running JS, not TS, but from what I'd read I was under the impression the TS could be debugged directly. Am I just wrong on that point? Is it working as it should and my assumptions are incorrect?
Thanks for taking the time to answer!
My question is about debugging this TS/JS. I read and tried to follow the MS guide here https://learn.microsoft.com/en-us/visualstudio/javascript/debug-nodejs?view=vs-2022, but the only breakpoints that are being hit are when I go into my browser dev tools, then set a breakpoint on the JS from within the browser. Visual Studio will notice that, and I can inspect objects at the breakpoint from either the browser or a temporal tab that shows up in VS. Breakpoints that I set in the TS or JS within Visual Studio directly are not being hit.
I feel like / imagined that I could set a breakpoint on the TS in Visual Studio, and deal with it from there -- is that just not how it works? I understand that the browser will be running JS, not TS, but from what I'd read I was under the impression the TS could be debugged directly. Am I just wrong on that point? Is it working as it should and my assumptions are incorrect?
Thanks for taking the time to answer!
Visual Studio provides support for debugging JavaScript and TypeScript apps in Visual Studio.
