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

Debug blazor in vscode prompted "cannot launch browser: The URL's protocol must be one of "ws","wss:, or "ws+nuix;""" #45257

Closed
LZD121 opened this issue Nov 24, 2022 · 13 comments
Assignees
Labels
area-blazor Includes: Blazor, Razor Components External This is an issue in a component not contained in this repository. It is open for tracking purposes. feature-blazor-debugging This issue is related to debugging of Blazor WebAssembly apps feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. Status: Resolved

Comments

@LZD121
Copy link

LZD121 commented Nov 24, 2022

My launch.json:
image

The chrome is opened, but displays blank page.

@TanayParikh TanayParikh added feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly area-blazor Includes: Blazor, Razor Components feature-blazor-debugging This issue is related to debugging of Blazor WebAssembly apps and removed feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly labels Nov 24, 2022
@javiercn
Copy link
Member

@LZD121 thanks for contacting us.

@TanayParikh can you take a look at this?

@javiercn javiercn added this to the .NET 8 Planning milestone Nov 24, 2022
@ghost
Copy link

ghost commented Nov 24, 2022

To learn more about what this message means, what to expect next, and how this issue will be handled you can read our Triage Process document.
We're moving this issue to the .NET 8 Planning milestone for future evaluation / consideration. Because it's not immediately obvious what is causing this behavior, we would like to keep this around to collect more feedback, which can later help us determine how to handle this. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact work.

@jorgepinetta
Copy link

I have the same problem since time ago. I assumed it was a local problem. In VS2022 everything works fine. In VSCODE the debug does not work well. I had the problem with .NET6, I upgraded to .NET7 and the problem is still the same.

With edge there is no difference.

While I wait for a solution I debug with the chrome developer tools. It more or less meets my needs, at moment.
Workarround steps in windows command line:
dotnet run
"chrome-path\chrome.exe" --remote-debugging-port=9222 --user-data-dir="user-data-path\AppData\Local\Temp\blazor-chrome-debug" scheme://localhost:port/
And now in chrome: shift+alt+D. Then debug blazor in file://

Thanks @LZD121 !

@TanayParikh TanayParikh added the feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly label Dec 1, 2022
@TanayParikh
Copy link
Contributor

TanayParikh commented Dec 1, 2022

You'll need to add the inspectUri property. Please see the documentation here for more information.

Marking this as resolved. Please let us know if you're still experiencing this issue after following the guidance in the documentation above.

@TanayParikh TanayParikh added the ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. label Dec 1, 2022
@ghost ghost added the Status: Resolved label Dec 1, 2022
@jorgepinetta
Copy link

Hi, @TanayParikh thanks. I have followed all the steps of the documentation but it does not solve the problem.

I do the tests by creating a clean project.

image

@jorgepinetta
Copy link

More info,

With Microsoft.AspNetCore.Razor.VSCode.BlazorWasmDebuggingExtension v1.1.0 and v1.0.1 the same error happens.

But, with Microsoft.AspNetCore.Razor.VSCode.BlazorWasmDebuggingExtension v1.0.0 apparently it launches the browser fine, and the debug proxy connects.
I only comment this in case it helps you, since version 1.0.0 fails for other reasons.

@TanayParikh
Copy link
Contributor

cc/ @thaystg in case you have context on this issue

@TanayParikh TanayParikh removed ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. Status: Resolved labels Dec 2, 2022
@thaystg
Copy link
Member

thaystg commented Dec 2, 2022

Yes, this is fixed in this PR: dotnet/razor#7929
We need to merge it and ship it, I'm not sure how to do it :)

@jorgepinetta
Copy link

Thanks @thaystg

@TanayParikh TanayParikh added External This is an issue in a component not contained in this repository. It is open for tracking purposes. ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. and removed investigate labels Dec 2, 2022
@ghost ghost added the Status: Resolved label Dec 2, 2022
@ghost
Copy link

ghost commented Dec 3, 2022

This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.

See our Issue Management Policies for more information.

@ghost ghost closed this as completed Dec 3, 2022
@MSqrl
Copy link

MSqrl commented Dec 19, 2022

I don't believe this issue is resolved because I am experiencing it now in VSCode using the blazorwasm template with no modifications. I get the same "Unable to launch browser" issue.

@TanayParikh
Copy link
Contributor

TanayParikh commented Dec 19, 2022

The issue has been resolved via the PR mentioned above. The code hasn't yet shipped so you'll still be seeing the older behavior for now.

@gbelenky
Copy link

gbelenky commented Dec 22, 2022

I have the same issue.

  • I start Edge in the debugger - no page is loaded
  • I insert manually the url of my project into the Edge debugger
  • Blazor wasm app loads
  • After a short time the Edge in debugger stops working and quits.
  • I see the error message above

When will be the fix shipped?

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components External This is an issue in a component not contained in this repository. It is open for tracking purposes. feature-blazor-debugging This issue is related to debugging of Blazor WebAssembly apps feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. Status: Resolved
Projects
None yet
Development

No branches or pull requests

7 participants