当我运行应用程序时,浏览器控制台会抛出三个相同的错误,指出
Could not find 'AuthenticationService.init' ('AuthenticationService' was undefined).
和 Microsoft.JSInterop.JSException: Could not find 'AuthenticationService.init' ('AuthenticationService' was undefined).
但是,我找不到任何对
AuthenticationService.init
的引用,只有AuthenticationService.js
,也找不到它的任何文档,所以我想知道这是否意味着我已将“.js”替换为“.init” ,但我在整个解决方案中找不到以“.init”结尾的单个文件(甚至在文件资源管理器上查找)。
我检查了index.html,它具体指的是
<script src="_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js" />
像往常一样。
我在任何地方都没有看到对 AuthenticationService.init 的引用,也找不到 JSInterop.JSException。
感谢任何帮助,谢谢。
我有一个用 .NET 7 编写的客户端 Blazor 项目。我最近偶然发现了同样的错误。就我而言,这是 AuthenticationService.js 的错误链接。
正确的是
<script src="_content/Microsoft.Authentication.WebAssembly.Msal/AuthenticationService.js"></script>