Megabit / Blazorise

Blazorise is a component library built on top of Blazor with support for CSS frameworks like Bootstrap, Tailwind, Bulma, AntDesign, and Material.
https://blazorise.com/
Other
3.29k stars 530 forks source link

Sidebar causing Task Cancelled #3920

Open JezPops opened 2 years ago

JezPops commented 2 years ago

The following css is in place, due to a long data fetch the sidebar never shows without it : .b-bar-initial { display: block !important; }

When selecting any bar item on the sidebar, anytime after the initial load I receive the following error message:

Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit 'CIS4QWe0NDaaZC1UA0UZXDV9acVIEZy_cWBM0ckDHaI'. System.Threading.Tasks.TaskCanceledException: A task was canceled. at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args) at Blazorise.Modules.JSBreakpointModule.GetBreakpoint() at Blazorise.Bar.OnLocationChanged(Object sender, LocationChangedEventArgs args) at System.Threading.Tasks.Task.<>c.b__128_0(Object state) at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteSynchronously(TaskCompletionSource`1 completion, SendOrPostCallback d, Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteBackground(WorkItem item)

With the sidebar collapsed I do not receive this error when selecting bar items.

@using Blazorise;
@using VectorBlazor.Data;
@using Microsoft.AspNetCore.Identity;

<Bar Breakpoint="Breakpoint.Desktop"
     NavigationBreakpoint="Breakpoint.Tablet"
     Background="Background.Primary"
     ThemeContrast="ThemeContrast.Light"
     Mode="BarMode.VerticalInline"
     CollapseMode="BarCollapseMode.Small">
    <BarToggler />

    <BarBrand Flex="Flex.AlignItems.Start">
        @*<img id="CSY_Logo" src="/img/logo.png" style="width: 100%; height: 3.5rem;" alt="CSY_Logo" draggable="false" />*@
    </BarBrand>
    <BarMenu>
        <BarStart>
            <BarItem>
                <BarLink To="Dashboard">
                    <BarIcon IconName="@("fa-cubes")" />
                    Dashboard
                </BarLink>
            </BarItem>
            <BarItem>
                <BarLink To="DailyBranches/DailySales">
                    <BarIcon IconName="@("fa-chart-pie")" />
                    Sales
                </BarLink>
            </BarItem>
            <BarItem>
                <BarLink To="DailyBranches/TradingPattern">
                    <BarIcon IconName="@("fa-chart-bar")" />
                    Trade Pattern
                </BarLink>
            </BarItem>
            <BarItem>
                <BarLink To="DailyBranches/LFL">
                    <BarIcon IconName="@("fa-chart-pie")" />
                    LFL
                </BarLink>
            </BarItem>
            <BarItem>
                <BarLink To="DailyBranches/Departments">
                    <BarIcon IconName="@("fa-chart-pie")" />
                    Departments
                </BarLink>
            </BarItem>
            <AuthorizeView Roles="Administrators,User Admin">
                <Authorized>
                    <BarItem>
                        <BarLink To="administration">
                            <BarIcon IconName="@("fa-solid fa-screwdriver-wrench")" />
                            Administration
                        </BarLink>
                    </BarItem>
                </Authorized>
            </AuthorizeView>
        </BarStart>
    </BarMenu>
</Bar>

Using Blazorise 1.05 Blazor Server FirebirdSQL and Dapper

Possible duplicate of this one #2244. Will see if i can create a small repo. But this is happening with a particularly large database so not sure it will repo anything !

JezPops commented 2 years ago

Changing both of these Breakpoint="Breakpoint.Desktop" NavigationBreakpoint="Breakpoint.Tablet" To Breakpoint.None fixes it?