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

Unable to launch browser #3819

Closed
ofrades opened this issue Jun 1, 2020 · 6 comments
Closed

Unable to launch browser #3819

ofrades opened this issue Jun 1, 2020 · 6 comments

Comments

@ofrades
Copy link

ofrades commented Jun 1, 2020

I get this error when I try to launch debug from vscode with the new support for one-step debugging for Blazor #1885

Unable to launch browser: "Could not open wss://localhost:5001/_framework/debug/ws-proxy?browser=ws%3A%2F%2F127.0.0.1%3A53267%2Fdevtools%2Fbrowser%2F53f91446-8e68-4407-95d8-d9c70558ff11": timeout after 30000ms

If I delete everything from .vscode folder I get the same error. I have the the latest Nightly JavaScript Debugger and the latest C# Extension.

Environment information

VSCode version: 1.46.0-insider
C# Extension: 1.22.0
JavaScript Debugger (Nightly): v2020.5.2917

Dotnet Information .NET SDK (reflecting any global.json): Version: 5.0.100-preview.4.20258.7 Commit: 65f0fc2cad

Runtime Environment:
OS Name: Mac OS X
OS Version: 10.15
OS Platform: Darwin
RID: osx.10.15-x64
Base Path: /usr/local/share/dotnet/sdk/5.0.100-preview.4.20258.7/

Host (useful for support):
Version: 5.0.0-preview.4.20251.6
Commit: 47ec733ba7

.NET SDKs installed:
5.0.100-preview.4.20258.7 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.0-preview.4.20257.10 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.0-preview.4.20251.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

@gregg-miskelly
Copy link
Contributor

CC @captainsafia

@captainsafia
Copy link
Member

Let's see if we can figure this out, @ofrades.

Typically, the error that you received occurs if the Blazor dev server has not started by the time the browser is launched. This can occur for a few reasons:

  • A build error in your application prevents it from running correctly
  • The application you are debugging is a hosted app but your config is associated with a standalone app
  • Your application has a complicated build setup and takes longer than 30 seconds to build and run

To help debug this, can you check if:

  • dotnet run works on your application without failing
  • What the contents of your launch.json are?

@ofrades
Copy link
Author

ofrades commented Jun 1, 2020

Thank for the reply @captainsafia.

dotnet run works without errors.

I have tried several launch.json configuration. If I run F5 without one, select the Blazor WebAssembly Debug, vscode creates this one for me:

{
	// Use IntelliSense to learn about possible attributes.
	// Hover to view descriptions of existing attributes.
	// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
	"version": "0.2.0",
	"configurations": [
		{
			"type": "blazorwasm",
			"name": "Launch and Debug Blazor WebAssembly Application",
			"request": "launch"
		}
	]
}

Another thing I just noticed is that if I am running the app with dotnet run and run the debug (which makes no sense) I get one error that might be useful:

It was not possible to find any compatible framework version
The framework 'Microsoft.AspNetCore.App', version '3.1.0' was not found.
  - The following frameworks were found:
      5.0.0-preview.4.20257.10 at [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

I am using Blazor 3.2.0 by the way and the only sdk I have is 5.0.100-preview.4.20258.7

@captainsafia
Copy link
Member

I am using Blazor 3.2.0 by the way and the only sdk I have is 5.0.100-preview.4.20258.7

The 3.1.3 SDK is required in order to run Blazor WASM applications. This is likely what is causing the failure in this case. Blazor WASM isn't bundled with 5-preview4.

@ofrades
Copy link
Author

ofrades commented Jun 2, 2020

Yes, that's it! Thanks.

@ofrades ofrades closed this as completed Jun 2, 2020
@mahfuzmr
Copy link

In my case, it was one package missing :Microsoft.AspNetCore.Components.WebAssembly.DevServer
Happy coding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants