Closed petergolde closed 5 months ago
Hi.
Weird, but I cloned your project, started it and not errors, as well navigated all pages but still no errors.
Visual Studio Enterprise v17.8.3
Would be also nice if you could show "call stack".
In addition update the libraries just in case to the latest
the -rc
libraries have some bugs (https://github.com/MudBlazor/Templates/issues/453#issuecomment-1937365664)
It must have something to do with my Debug options. If I unchecked that "Break when this exception type is unhandled", then it continues and runs ok. After unchecking that, I can't get it to reproduce again.
Looking at the call stack, it seems like this is a sort-of expected exception to happen with JS interop during pre-rendering. It seems to me it would be better to somehow detect the pre-rendering and not do the JS interop at all, but I suppose its OK the way it is.
It is not clear to me why my Visual Studio thought the exception was unhandled. Strange.
I guess it is fine to close this, but it was a bad first impression for me with MudBlazor.
I'm not sure if it comes from our code or not, but Microsoft doesn't have any public API to identify what rendering mode is used, nor there is API to understand if the JsRuntime
is available. You can understand it in a razor component (after the OnAfterRenderAsync
lifecycle, and in our code we call JS in component when its available), but not in a service if it's using JS. There are also JS errors when circuit breaks JSDisconnectedException
, TaskCanceledException
and all we can do is to suppress those errors.
I had a similar error with WebAssembly interactivity setup, and it went away by explicitly defining the MudBlazor version, and also make sure you're targeting the latest version of the .Net Core. In short, my project file went from:
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0-rc.2.23480.2" />
<PackageReference Include="MudBlazor" Version="6.*" />
to:
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.2" />
<PackageReference Include="MudBlazor" Version="6.17.0" />
Hi everyone, I am working on upgrading the templates for MudBlazor 7.0.0 in this PR: https://github.com/MudBlazor/Templates/pull/465. I haven't seen this error but I will test this project type for you.
Bug type
Other
Component name
No response
What happened?
I created a new MudBlazor application using the template:
dotnet new mudblazor --auth Individual --int Server --all-interactive -o MudBlazorTest
Then opened the application in Visual Studio 2022 Community and hit run.
--> Execution stops in RemoteJSRuntime.BeginInvokeJS with InvalidOperationException. See screenshot attached.
Expected behavior
No exception thrown.
Reproduction link
https://github.com/petergolde/MudBlazorBugReport
Reproduction steps
Relevant log output
Version (bug)
6.16.0
Version (working)
No response
What browsers are you seeing the problem on?
Microsoft Edge
On what operating system are you experiencing the issue?
Windows
Pull Request
Code of Conduct