Fixing Unhandled Exception on the Current Circuit in Blazor

Blazor

I upgraded my digital card, https://jsmotta.com.br, from Telerik UI Blazor 4.4.0 to 4.6.0, and this message was thrown in the console log:

There was an unhandled exception on the current circuit, so this circuit will be terminated.

So I added to Program.cs a command to display the DetaildErrors.

builder.Services.AddServerSideBlazor().AddCircuitOptions(options => { options.DetailedErrors = true; });

So, I found the error on the console log.

The list of component records is not valid.

Together, another error was throwing while clicking on the buttons

Error: Cannot send data if the connection is not in the 'Connected' State.

How did I fix it?

Looking at the documentation, I found an outdated code during the migration in _Host.cshtml file.

<link href="https://blazor.cdn.telerik.com/blazor/4.4.0/kendo-theme-fluent/swatches/fluent-main.css" rel="stylesheet" type="text/css" />
<script src="https://blazor.cdn.telerik.com/blazor/4.4.0/telerik-blazor.min.js" defer></script>

I forgot to upgrade to the new version, 4.6.0, but it's not only this,

The solution was added to the local _content, so at the next upgrade, it will not be necessary to fix this again:

  <script src="_content/Telerik.UI.for.Blazor/js/telerik-blazor.js" defer></script>

And the link I only upgraded, for now, to the 4.6.0 link:

<link href="https://blazor.cdn.telerik.com/blazor/4.6.0/kendo-theme-fluent/swatches/fluent-main.css" rel="stylesheet" type="text/css" />

For your solution, you could find other problems when enabling the DetaildErrors.

I hope the article helps you with similar problems.

If it helped you, please, leave me a like and a comment.

Have a nice coding.


Similar Articles