Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Client Cannot find "AuthenticaionService.init"

When I run my application, the browser console throws three, identical errors stating Could not find 'AuthenticationService.init' ('AuthenticationService' was undefined). and Microsoft.JSInterop.JSException: Could not find 'AuthenticationService.init' ('AuthenticationService' was undefined).

However, I cannot find any reference to AuthenticationService.init, only AuthenticationService.js, nor can I find any documentation of it anywhere, so I'm wondering if this might mean that I have swapped ".js" with ".init", but I can't find a single file in my entire solution (even looking on file explorer) that ends with ".init".

I have checked index.html and it specifically refers to

    <script src="_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js" />

as usual.

I see no reference to AuthenticationService.init anywhere and can't find JSInterop.JSException.

Any help is appreciated, thanks.

like image 215
Email User Avatar asked May 30 '26 20:05

Email User


1 Answers

I have a client-side Blazor project written in .NET 7. I've stumbled upon the same error lately. In my case it was an incorrect link to the AuthenticationService.js.

The correct one is

<script src="_content/Microsoft.Authentication.WebAssembly.Msal/AuthenticationService.js"></script>
like image 130
Mykhailo Smereka Avatar answered Jun 02 '26 12:06

Mykhailo Smereka