I get an error of
Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: Could not find 'encryptMessage' ('encryptMessage' was undefined).
Error: Could not find 'encryptMessage' ('encryptMessage' was undefined).
When I run my blazor application. This is the script in the index.html
<script>
... OTHER FUNCTIONS
function encryptMessage(message, key) {
console.log("HERE")
}
</script>
and this is in my component cs
using Microsoft.JSInterop;
[Inject] IJSRuntime? mJsRunTime { get; set; }
private async Task Login()
{
await mJsRunTime!.InvokeVoidAsync("encryptMessage", $@"{username}:{password}", "usernamwe");
}