Skip to content

Blazor browser crashes #25519

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

Closed
connor4312 opened this issue Sep 2, 2020 · 14 comments
Closed

Blazor browser crashes #25519

connor4312 opened this issue Sep 2, 2020 · 14 comments
Labels
affected-few This issue impacts only small number of customers area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. 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 investigate reevaluate We need to reevaluate the issue and make a decision about it severity-major This label is used by an internal tool
Milestone

Comments

@connor4312
Copy link

Hi, I came here from https://devblogs.microsoft.com/aspnet/blazor-webassembly-3-2-0-preview-3-release-now-available/
And seems like pwa-msedge doesn't work.
I have latest MS Edge installed ( Version 80.0.361.69 (Official build) (64-bit) ) "debug.javascript.usePreview": true and this is my launch.json:

{
            "name": ".NET Core Debug Blazor Web Assembly in Edge",
            "type": "pwa-msedge",
            "request": "launch",
            "timeout": 30000,
            "url": "https://localhost:5001",
            "webRoot": "${workspaceFolder}/Server",
            "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}"
}

When I trying to start debug I see this error:
image

Unable to launch browser: "Failed to launch browser!
[0327/171300.005:ERROR:file_io.cc(89)] ReadExactly: expected 120, observed 40

TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

Can you help me find out what's wrong?

_Originally posted by @vchirikov in microsoft/vscode-js-debug#405

I've been getting a steady trickle of reports on this from people using Blazor, reported on both Chrome and Edge. @digeff reports that they haven't seen this on VS, and I haven't received reports on this from any non-Blazor users. Is there anything Blazor is doing differently that could cause this? Trees to bark up would also be appreciated 😛

@captainsafia
Copy link
Member

@connor4312 The debugging setup in Blazor is definitely a little different than a standard JS debugging experience.

I'm a little surprised at the exception thrown here. It seems to be coming from the Chrome launcher itself, which comes into play before the Blazor app has launched. The entire flow for debugging Blazor WASM in VS Code looks something like this (assuming the user uses blazorwasm debug type).

  1. User presses F5.
  2. VS Code passes the debugging request to our debugging config resolver.
  3. The blazorwasm config provider spawns a process running dotnet run in the current working directory (or a cwd provided by the user).
  4. The blazorwasm config provider starts a JS debugging session throw either pwa-msedge or pwa-chrome.
  5. The JS debugger sends a request to http://localhost:5001/_framework/debug/ws-proxy/...
  6. The Blazor server receives the request from HelloConsole folder does not exist. The actual folder name is ConsoleApp... #5 and starts the Mono debug proxy. The JS debugger sends CDP messages to this endpoint.
  7. The Chrome browser is started.

You might have some more insights, @connor4312, about the exact ordering of 5-7. Perhaps the fact that the JS debugger communicates with the application server causes some issues here? Although I dunno why that would surface the stack traces we are seeing from Chrome.

@captainsafia captainsafia added area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly labels Sep 2, 2020
@connor4312
Copy link
Author

It seems like we haven't gotten any trace logs yet, so I've asked in the other issue to collect some. That should help understand the ordering.

@ghost
Copy link

ghost commented Sep 2, 2020

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@aventus13
Copy link

aventus13 commented Sep 2, 2020

Please see attached for the trace logs
vscode-debugadapter-0.json.gz

@connor4312
Copy link
Author

connor4312 commented Sep 2, 2020

That appears to be a separate issue, looks like the Blazor proxy is not running:

"Unable to launch browser: "Could not open ws://localhost:5001/_framework/debug/ws-proxy?browser=ws%3A%2F%2F127.0.0.1%3A50835%2Fdevtools%2Fbrowser%2F57772b19-838c-45c9-9a60-20ea02b21f62""

(thrown from new Websocket(...).on('error')

@aventus13
Copy link

Should I raise a separate issue for it then? Am I missing some setup? How do I run the Blazor proxy?

@captainsafia
Copy link
Member

@aventus13 You're in our repo now. Can you share the version of Blazor that you were using when you encountered this issue?

Thanks,
Safia

@SteveSandersonMS SteveSandersonMS added affected-few This issue impacts only small number of customers bug This issue describes a behavior which is not expected - a bug. severity-major This label is used by an internal tool labels Oct 7, 2020 — with ASP.NET Core Issue Ranking
@ghost
Copy link

ghost commented Oct 9, 2020

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@javiercn javiercn added reevaluate We need to reevaluate the issue and make a decision about it feature-blazor-debugging This issue is related to debugging of Blazor WebAssembly apps labels Apr 20, 2021
@pranavkm
Copy link
Contributor

Thanks for contacting us. We're closing this issue as there was no community involvement here for quite a while now.

You can learn more about our triage process and how we handle issues by reading our Triage Process writeup.

@vchirikov
Copy link

vchirikov commented Nov 13, 2021

And it still doesn't work :D

I tried:

dotnet new blazorwasm --no-restore

launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "blazorwasm",
            "name": "Launch and Debug Blazor WebAssembly Application",
            "request": "launch",
            "browser": "edge",
        }
    ]
}

ms-dotnettools.blazorwasm-companion-1.1.0
dotnet 6.0

bug

cc: @pranavkm @captainsafia

@captainsafia
Copy link
Member

@vchirikov Can you file another issue? The problem you are reporting is distinct from the one discussed here.

@vchirikov
Copy link

@captainsafia I found the reason, it's occupied port 9222.
vs / vscode use the hard-coded value --remote-debugging-port=9222 and I'm already using the port in another browser.
That's why msedge crashes. By the way, Rider uses --remote-debugging-port=0 and it worked without any investigations :) I think vs / vscode should check open ports before starting debugging or use a random port.

@captainsafia
Copy link
Member

@captainsafia I found the reason, it's occupied port 9222. vs / vscode use the hard-coded value --remote-debugging-port=9222 and I'm already using the port in another browser. That's why msedge crashes. By the way, Rider uses --remote-debugging-port=0 and it worked without any investigations :) I think vs / vscode should check open ports before starting debugging or use a random port.

I believe VS already uses a random port and VS Code looks for available ports on the machine to use (ref) so I'm not sure that would explain the issue.

In any case, I'm glad you were able to find a resolution.

@vchirikov
Copy link

@captainsafia your code doesn't work:
image

@ghost ghost locked as resolved and limited conversation to collaborators Dec 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affected-few This issue impacts only small number of customers area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. 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 investigate reevaluate We need to reevaluate the issue and make a decision about it severity-major This label is used by an internal tool
Projects
None yet
Development

No branches or pull requests

8 participants