question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unbound breakpoint in VS Code when debugging Blazor WASM app on WSL 2

See original GitHub issue

Describe the bug

I cannot set a breakpoint when debugging a WASM app on VS Code (WSL 2) following the instructions here: https://docs.microsoft.com/en-us/aspnet/core/blazor/debug?view=aspnetcore-3.1

To Reproduce

  1. Create a new WASM project: dotnet new blazorwasm -o Foo
  2. Follow VS Code debugging instructions here: https://docs.microsoft.com/en-us/aspnet/core/blazor/debug?view=aspnetcore-3.1
  3. Set a breakpoint in the IncrementCount method in the Counter component (Counter.razor).

Expected: Breakpoint resolves Actual: Unbound breakpoint

Debug Console output from .NET Core Debug Blazor Web Assembly In Chrome:

Note: Using the “preview” debug extension null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. null: Uncaught DOMException: Entry already exists. blazor Loaded 4.59 MB resources This application was built with linking (tree shaking) disabled. Published applications will be significantly smaller. mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28 null: Uncaught DOMException: Entry already exists.

If I expand one of the Uncaught exceptions above, I see following:

u @ localhost꞉5001/_framework/blazor.webassembly.js:1:45332 ◀ Promise.then ▶ s @ localhost꞉5001/_framework/blazor.webassembly.js:1:45401 a @ localhost꞉5001/_framework/blazor.webassembly.js:1:45263 ◀ Promise.then ▶ s @ localhost꞉5001/_framework/blazor.webassembly.js:1:45401 <anonymous> @ localhost꞉5001/_framework/blazor.webassembly.js:1:45411 r @ localhost꞉5001/_framework/blazor.webassembly.js:1:45211 e.addToCacheAsync @ localhost꞉5001/_framework/blazor.webassembly.js:1:49122 <anonymous> @ localhost꞉5001/_framework/blazor.webassembly.js:1:49032 <anonymous> @ localhost꞉5001/_framework/blazor.webassembly.js:1:46416 <anonymous> @ localhost꞉5001/_framework/blazor.webassembly.js:1:46521 a @ localhost꞉5001/_framework/blazor.webassembly.js:1:45267 ◀ Promise.then ▶ s @ localhost꞉5001/_framework/blazor.webassembly.js:1:45401 a @ localhost꞉5001/_framework/blazor.webassembly.js:1:45263 ◀ Promise.then ▶ s @ localhost꞉5001/_framework/blazor.webassembly.js:1:45401 <anonymous> @ localhost꞉5001/_framework/blazor.webassembly.js:1:45411 r @ localhost꞉5001/_framework/blazor.webassembly.js:1:45211 e.loadResourceWithCaching @ localhost꞉5001/_framework/blazor.webassembly.js:1:48588 e.loadResource @ localhost꞉5001/_framework/blazor.webassembly.js:1:47125 <anonymous> @ localhost꞉5001/_framework/blazor.webassembly.js:1:36314 <anonymous> @ localhost꞉5001/_framework/blazor.webassembly.js:1:35494 <anonymous> @ localhost꞉5001/_framework/blazor.webassembly.js:1:35599 <anonymous> @ localhost꞉5001/_framework/blazor.webassembly.js:1:34512 r @ localhost꞉5001/_framework/blazor.webassembly.js:1:34289 p.instantiateWasm @ localhost꞉5001/_framework/blazor.webassembly.js:1:36194 createWasm @ localhost꞉5001/_framework/wasm/dotnet.3.2.0-preview3.20168.1.js:1:18234 <anonymous> @ localhost꞉5001/_framework/wasm/dotnet.3.2.0-preview3.20168.1.js:1:184118

Further technical details

  • ASP.NET Core version
  • Include the output of dotnet --info
  • The IDE (VS / VS Code/ VS4Mac) you’re running on, and it’s version

Environment:

  • VS Code: 1.43.2
  • C# Extension: 1.21.16
  • JavaScript Debugger (Nightly): 2020.4.317
  • JavaScript Debugger Companion: 0.0.4
  • Chrome: 78.0.3904.130
  • WSL 2.0 on Windows 10: 19592.1001

dotnet --info:

.NET Core SDK (reflecting any global.json): Version: 3.1.201 Commit: b1768b4ae7

Runtime Environment: OS Name: ubuntu OS Version: 18.04 OS Platform: Linux RID: ubuntu.18.04-x64 Base Path: /usr/share/dotnet/sdk/3.1.201/

Host (useful for support): Version: 3.1.3 Commit: 4a9f85e9f8

.NET Core SDKs installed: 2.2.402 [/usr/share/dotnet/sdk] 3.1.201 [/usr/share/dotnet/sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.2.7 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.2.7 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.2.7 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.3 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
InsaneWookiecommented, Apr 26, 2020

I ran into the same issue I think when setting up a brand new install. Looks like possibly some https issue. I was able to get debugging working in VS Code on Ubuntu using http instead of https.

In launch.json under the “.NET Core Debug Blazor Web Assembly in Chrome” launch configuration, change url to “http://localhost:5000

Full launch config

{
    "name": ".NET Core Debug Blazor Web Assembly in Chrome",
    "type": "pwa-chrome",
    "request": "launch",
    "timeout": 30000,
    // If you have changed the default port / launch URL make sure to update the expectation below
    "url": "http://localhost:5000",
    "webRoot": "${workspaceFolder}",
    "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}"
}

0reactions
captainsafiacommented, Jun 4, 2020

I’ll close this issue as a dupe of #21466 as the issue with the DebugProxy not being launched is a result of issues with making inbound requests to the WSL.

It’s likely that the issues that are resolved by accepting local dev certs happen in WSL instances that are already configuring to support arbitrary inbound connections.

If folks still have issues with this that aren’t related to the above, please open another issue. It makes it easier to debug and peel out different issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging Blazor WASM in VS Code fails because of ...
This workaround got VSCode breakpoints to hit for me. Changing my launch.json to : { "version": "0.2.0", "configurations": [ { "name": ".
Read more >
Debug ASP.NET Core Blazor WebAssembly
Visual Studio Code. Available scenarios include: Set and remove breakpoints. Run the app with debugging support in IDEs. Single-step through the ...
Read more >
Troubleshoot Breakpoints in the Visual Studio Debugger
If you're debugging optimized code, make sure the function where your breakpoint is set isn't being inlined into another function. The Debugger.
Read more >
Debug Blazor WASM on VSCode not working (.net6)
Hi,. I have created a brand new Blazor Wasm project with net 6.0. Debug breakpoints are not being hit in VS Code.
Read more >
[Solved]-Debugging Blazor WASM in VS Code fails because ...
Coding example for the question Debugging Blazor WASM in VS Code fails because of Unbound breakpoint-blazor.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found