Skip to content

Server-side appears to be broken #86

@chucker

Description

@chucker

I don't generally use it, but tested it for #85.

I get:

System.InvalidOperationException: JavaScript interop calls cannot be issued at this time. This is because the component is being statically rendererd. When prerendering is enabled, JavaScript interop calls can only be performed during the OnAfterRenderAsync lifecycle method.
at Microsoft.AspNetCore.Components.Server.Circuits.RemoteJSRuntime.BeginInvokeJS(Int64 asyncHandle, String identifier, String argsJson)
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](String identifier, CancellationToken cancellationToken, Object[] args)
at Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation[T](String identifier, Object[] args)
at Blazor.Gitter.Core.LocalisationHelper.BuildLocalCulture() in …/src/Blazor.Gitter.Core/Services/LocalisationHelper.cs:line 39

It appears changing @(await Html.RenderComponentAsync<App>(RenderMode.ServerPrerendered)) to RenderMode.Server fixes this. But maybe there was a purpose in prerendering?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions