Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server-side appears to be broken #86

Open
chucker opened this issue Jun 7, 2020 · 0 comments
Open

Server-side appears to be broken #86

chucker opened this issue Jun 7, 2020 · 0 comments

Comments

@chucker
Copy link

chucker commented Jun 7, 2020

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant