Skip to content
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

Cannot hit breakpoints in Javascript when running Blazor web app with .NET Aspire #7368

Open
1 task done
kp2eukodyne opened this issue Feb 2, 2025 · 0 comments
Open
1 task done
Labels
area-tooling untriaged New issue has not been triaged

Comments

@kp2eukodyne
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I have attached a basic demo app project where I link site.js in App.razor.
Steps to reproduce the issue:

  1. Build solution
  2. Set a breakpoint in site.js / testBreakpoint1 function on the console.log() call. This breakpoint works fine without Aspire orchestration in VS2022.
  3. Launch project, in Aspire dashboard / resources view click on the URL of the Blazor app on the localhost.
  4. On the Home screen, hit Invoke JS button. It does nothing but logging to JS console. Your breakpoint should be hit at this point. But it won't be.

I think the problem is that this opens in a new tab and the debugger may not be attached to it.

I do not like the idea of having to set breakpoints only in Dev Tools in the browser.

Can someone help me figure out how to make normal VS2022 breakpoints work in this scenario?

Thank you!

BlazorServerJsBreakpoints.zip

Expected Behavior

I expect to be able to hit the Javascript breakpoint when it is set in VS2022 in site.js.

Steps To Reproduce

  1. Build solution
  2. Set a breakpoint in site.js / testBreakpoint1 function on the console.log() call. This breakpoint works fine without Aspire orchestration in VS2022.
  3. Launch project, in Aspire dashboard / resources view click on the URL of the Blazor app on the localhost.
  4. On the Home screen, hit Invoke JS button. It does nothing but logging to JS console. Your breakpoint should be hit at this point. But it won't be.

Exceptions (if any)

No exceptions.

.NET Version info

.net 8

Anything else?

.NET Aspire 9.0.0

@davidfowl davidfowl added area-tooling untriaged New issue has not been triaged labels Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-tooling untriaged New issue has not been triaged
Projects
None yet
Development

No branches or pull requests

2 participants