Skip to content

Could not find 'BlazorExtensions' in 'window'. #10

@bzuidgeest

Description

@bzuidgeest

I just installed the webusb extension in my first blazor project. Unfortunately it gives me this error on the console.

Similar errors in the issuelists of other blazor extensions lead me to believe that this is caused by newer versions of blazor breaking something related to static content. But nothing I found suggested worked for me.

As to recreate, I just started a new blazor app from the vs template and added the extension. I also added the code from this project its testpage.

blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Could not find 'BlazorExtensions' in 'window'.
Error: Could not find 'BlazorExtensions' in 'window'.
at https://localhost:44355/_framework/blazor.webassembly.js:1:9130
at Array.forEach ()
at p (https://localhost:44355/_framework/blazor.webassembly.js:1:9090)
at https://localhost:44355/_framework/blazor.webassembly.js:1:9800
at new Promise ()
at Object.beginInvokeJSFromDotNet (https://localhost:44355/_framework/blazor.webassembly.js:1:9773)
at _mono_wasm_invoke_js_marshalled (https://localhost:44355/_framework/wasm/dotnet.3.2.0.js:1:171294)
at do_icall (https://localhost:44355/_framework/wasm/dotnet.wasm:wasm-function[6049]:0x10f8b1)
at do_icall_wrapper (https://localhost:44355/_framework/wasm/dotnet.wasm:wasm-function[1896]:0x50b6a)
at interp_exec_method (https://localhost:44355/_framework/wasm/dotnet.wasm:wasm-function[1120]:0x2588e)
Microsoft.JSInterop.JSException: Could not find 'BlazorExtensions' in 'window'.
Error: Could not find 'BlazorExtensions' in 'window'.
at https://localhost:44355/_framework/blazor.webassembly.js:1:9130
at Array.forEach ()
at p (https://localhost:44355/_framework/blazor.webassembly.js:1:9090)
at https://localhost:44355/_framework/blazor.webassembly.js:1:9800
at new Promise ()
at Object.beginInvokeJSFromDotNet (https://localhost:44355/_framework/blazor.webassembly.js:1:9773)
at _mono_wasm_invoke_js_marshalled (https://localhost:44355/_framework/wasm/dotnet.3.2.0.js:1:171294)
at do_icall (https://localhost:44355/_framework/wasm/dotnet.wasm:wasm-function[6049]:0x10f8b1)
at do_icall_wrapper (https://localhost:44355/_framework/wasm/dotnet.wasm:wasm-function[1896]:0x50b6a)
at interp_exec_method (https://localhost:44355/_framework/wasm/dotnet.wasm:wasm-function[1120]:0x2588e)
at System.Threading.Tasks.ValueTask`1[TResult].get_Result () <0x2df6dd0 + 0x00034> in :0
at Blazor.Extensions.WebUSB.USB.Initialize () [0x00041] in /home/runner/work/WebUSB/WebUSB/src/Blazor.Extensions.WebUSB/USB.cs:78
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask (System.Threading.Tasks.Task taskToHandle) <0x2db6878 + 0x000b6> in :0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions