Open tnglemongrass opened 8 months ago
@tnglemongrass Thank you for letting me know about the problem. I must have overlooked the Blazor Hybrid scenario. As a workaround for a while, could you try to add one <script>
tag in the wwwroot/index.html
for the content, "_content/Toolbelt.Blazor.GetProperty.Script/Toolbelt.Blazor.GetProperty.Script.lib.module.js", like the following pull request?
https://github.com/tnglemongrass/ToolbeltHotkeys2Demo/pull/1
Actually, I've never tried that workaround on my side yet because I've been a bit busy these weeks. I'm sorry for that. Anyway, I hope the workaround above works well. (And I'd like to fix this problem someday.)
@jsakamoto Yes, including that script tag fixes it. Thanks for looking into it and thanks a lot for that workaround!
@jsakamoto I was also having the same issue when trying to run ilovedotnet blazor wasm project via blazor hybrid project... Adding the script as mentioned solves the exception.
You can use https://github.com/ILoveDotNet/ilovedotnet/tree/main/MAUI to test.
[FYI] This problem is a bug in the .NET SDK.
See also: https://github.com/dotnet/maui/issues/15234
Fortunately, I've verified the problem went away on the .NET 9 SDK Preview 5. So, please take the workaround of explicitly adding a script loading as below until the release of the .NET 9 SDK.
<!-- wwwroot/index.html -->
<!-- 👇 Add this script tag before the script tag, which loads the "blazor.webview.js" JavaScript file. -->
<script src="_content/Toolbelt.Blazor.GetProperty.Script/Toolbelt.Blazor.GetProperty.Script.lib.module.js" type="module"></script>
I try to use the Hotkeys2 library in a MAUI Blazor Hybrid App with .NET 8, following the instructions from the Hotkeys2 README.
Maybe there is just something missing in the README instructions?
Description:
When using the HotKeys2 library in a Maui Blazor Hybrid App, an error/warning is displayed on startup. However, the app runs fine and hotkeys work as expected.
Steps to Reproduce:
Expected Behavior:
There should be no errors or warnings on startup.
Actual Behavior:
The following error message is displayed on startup:
Additional Information:
The app runs fine and hotkeys work as expected, despite the error message.
A minimal reproducible example is here: https://github.com/tnglemongrass/ToolbeltHotkeys2Demo/