Gitter icon indicating copy to clipboard operation
Gitter copied to clipboard

Server-side appears to be broken

Open chucker opened this issue 4 years ago • 0 comments

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?

chucker avatar Jun 07 '20 20:06 chucker