Repository navigation
Closed
Labels
arch-wasmWebAssembly architecturearea-Debugger-mononeeds-author-actionAn issue or pull request that requires more info or actions from the author.os-browserBrowser variant of arch-wasm
Description
Description
When loading a Javascript module in my Blazor wasm standalone app, and debugging, when passing over the line that imports the module, debugging is interrupted but not stopped entirely and I get this error:
[MONO] * Assertion: should not be reached at /__w/1/s/src/runtime/src/mono/mono/metadata/class-accessors.c:93
Error
at Mc (http://localhost:5238/_framework/dotnet.runtime.fn94ls2wwa.js:3:172298)
at dotnet.native.wasm.wasm_trace_logger (http://localhost:5238/_framework/dotnet.native.nc30dazgys.wasm:wasm-function[16401]:0x38357a)
at dotnet.native.wasm.eglib_log_adapter (http://localhost:5238/_framework/dotnet.native.nc30dazgys.wasm:wasm-function[3456]:0x10fb77)
at dotnet.native.wasm.monoeg_g_logv_nofree (http://localhost:5238/_framework/dotnet.native.nc30dazgys.wasm:wasm-function[3357]:0x10d5cf)
at dotnet.native.wasm.monoeg_assertion_message (http://localhost:5238/_framework/dotnet.native.nc30dazgys.wasm:wasm-function[3361]:0x10d775)
at dotnet.native.wasm.mono_assertion_message_unreachable (http://localhost:5238/_framework/dotnet.native.nc30dazgys.wasm:wasm-function[3364]:0x10d816)
at dotnet.native.wasm.mono_class_get_flags (http://localhost:5238/_framework/dotnet.native.nc30dazgys.wasm:wasm-function[4496]:0x14ee5e)
at dotnet.native.wasm.mono_class_setup_fields (http://localhost:5238/_framework/dotnet.native.nc30dazgys.wasm:wasm-function[4438]:0x147173)
at dotnet.native.wasm.init_sizes_with_info (http://localhost:5238/_framework/dotnet.native.nc30dazgys.wasm:wasm-function[4442]:0x149366)
at dotnet.native.wasm.mono_class_init_internal (http://localhost:5238/_framework/dotnet.native.nc30dazgys.wasm:wasm-function[4439]:0x1479b3)
program exited (with status: 1), but keepRuntimeAlive() is set (counter=4) due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)
MONO_WASM: Assert failed: .NET runtime already exited with 1 [MONO] * Assertion: should not be reached at /__w/1/s/src/runtime/src/mono/mono/metadata/class-accessors.c:93>Note: If I remove the breakpoint before the JS interop (using IJSRuntime), and put it after the module import, no error is thrown and the import is successful.
Reproduction Steps
- Create a blazor wasm standalone app
- Add a script to the wwwroot folder, say "js/theme.js"
- Add the script to the
index.htmlfile as a module
<script type="module" src="js/theme.js"></script>// theme.js
// determine if the default system theme is dark
export const isSystemThemeDark = () => {
return window.matchMedia('(prefers-color-scheme: dark)').matches ?? false;
}- Import the module in C# in VS 2026 insiders and put a breakpoint before the assignment to the module accessor
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
if (_themeAccessorJsRef is null)
{
_themeAccessorJsRef = await jsRuntime.InvokeAsync<IJSObjectReference>("import", "./js/theme.js");
}
}
await base.OnAfterRenderAsync(firstRender);
}- Run the app in debug mode default http profile
Expected behavior
The module should be assigned correctly and the breakpoint should work without issues
Actual behavior
The debugging with the breakpoint (that arrow of debugging) disappears. The debugging process does not stop and the app displays itself in the browser
Regression?
No response
Known Workarounds
Place the breakpoint after your JS interop calls
Configuration
I am on:
.NET 10 rc2
VS 2026 insiders
Chrome browser
Other information
No response
Metadata
Metadata
Assignees
Labels
arch-wasmWebAssembly architecturearea-Debugger-mononeeds-author-actionAn issue or pull request that requires more info or actions from the author.os-browserBrowser variant of arch-wasm
Activity
dotnet-policy-service commentedon Oct 19, 2025
Tagging subscribers to this area: @thaystg, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.
maraf commentedon Dec 18, 2025
There were several issue in .NET RC2 and Blazor WebAssembly. Can you please try again with the GA and report back if you still experience issues?
dotnet-policy-service commentedon Dec 18, 2025
This issue has been marked
needs-author-actionand may be missing some important information.dotnet-policy-service commentedon Dec 18, 2025
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.
dotnet-policy-service commentedon Jan 1, 2026
This issue has been automatically marked
no-recent-activitybecause it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will removeno-recent-activity.dotnet-policy-service commentedon Jan 16, 2026
This issue will now be closed since it had been marked
no-recent-activitybut received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.