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

JavaScript interop calls cannot be issued at this time - problem and solution #228

Open
kkrysztofczyk opened this issue Nov 20, 2022 · 0 comments

Comments

@kkrysztofczyk
Copy link

That code can be executed not correctly:

protected override async Task OnInitialized()
{
var window = await jsRuntime.Window();
}

In that case, you will get the error:

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.

In most cases, it can be easily solved when we will move that to another method that is executed later.

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