我创建了一个 PWA,并希望使用 MudBlazor 作为 UI,从 MudBlazor 模板“Wasm-PWA”项目中获取代码。到目前为止,我已经尝试过 Chrome 和 Edge,将 MudBlazor 模板项目与我自己的 PWA 项目进行比较,但无法发现差异。我也尝试过删除广告拦截,但没有取得任何成功。
页面上的错误是:
Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Could not find 'mudElementRef.getBoundingClientRect' ('mudElementRef' was undefined).
Error: Could not find 'mudElementRef.getBoundingClientRect' ('mudElementRef' was undefined).
at https://localhost:44368/_framework/blazor.webassembly.js:1:328
at Array.forEach (<anonymous>)
at a.findFunction (https://localhost:44368/_framework/blazor.webassembly.js:1:296)
at _ (https://localhost:44368/_framework/blazor.webassembly.js:1:2437)
at https://localhost:44368/_framework/blazor.webassembly.js:1:3325
at new Promise (<anonymous>)
at Object.beginInvokeJSFromDotNet (https://localhost:44368/_framework/blazor.webassembly.js:1:3306)
at Object.St [as invokeJSFromDotNet] (https://localhost:44368/_framework/blazor.webassembly.js:1:59849)
at _mono_wasm_invoke_js_blazor (https://localhost:44368/_framework/dotnet.6.0.4.p3odw0yl22.js:1:195300)
at wasm://wasm/00970c26:wasm-function[219]:0x1a0fb
Microsoft.JSInterop.JSException: Could not find 'mudElementRef.getBoundingClientRect' ('mudElementRef' was undefined).
Error: Could not …Run Code Online (Sandbox Code Playgroud)