客户端找不到“AuthenticaionService.init”

问题描述 投票:0回答:1

当我运行应用程序时,浏览器控制台会抛出三个相同的错误,指出

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。

感谢任何帮助,谢谢。

javascript html runtime-error blazor-webassembly
1个回答
0
投票

我有一个用 .NET 7 编写的客户端 Blazor 项目。我最近偶然发现了同样的错误。就我而言,这是 AuthenticationService.js 的错误链接。

正确的是

<script src="_content/Microsoft.Authentication.WebAssembly.Msal/AuthenticationService.js"></script>
© www.soinside.com 2019 - 2024. All rights reserved.