Open
Description
Describe the bug
Unexpected token . in Blazor Webview I'm encountering a SyntaxError: Unexpected token . in my Blazor Webview application. The error details are as follows:
blazor.webview.js:1 Unexpected token .
SyntaxError: Unexpected token .
at Microsoft.JSInterop.JSRuntime.<InvokeAsync>d__16`1[[Microsoft.JSInterop.IJSObjectReference, Microsoft.JSInterop, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext()
at Blazored.Modal.BlazoredModal.OnAfterRenderAsync(Boolean firstRender)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
NotifyUnhandledException @ blazor.webview.js:1
To Reproduce
Steps to reproduce the behavior:
- Create new .NET MAUI Hybrid project
- Add Blazored.Modal to the project
- Add
CascadingBlazoredModal
around the router as mentioned in the documentation - Start app in android emulator.
Expected behavior
App starts normally without any errors and I am able to show a modal after button click
Hosting Model (is this issue happening with a certain hosting model?):
- MAUI Blazor Hybrid
Additional context
This is how my Routes.Razor looks like
@using Blazored.Modal
<CascadingBlazoredModal>
<Router AppAssembly="@typeof(MauiProgram).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
</Router>
</CascadingBlazoredModal>
I have tracked down the interop call location to this line in Blazored.Modal.
Looking at another (microsoft) component named QuickGrid I see that there is not really a difference.