Closed MRakesh closed 3 years ago
Thanks for contacting us.
We're moving this issue to the Next sprint planning
milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.
@MRakesh Thanks for reporting this issue. What is the specific error that you get on Android?
I am not sure how to see the error in emulator and the debugger is not working for Maui-Blazor app in my VS but at the bottom that says unhandled exception Reload
I am not sure how to see the error in emulator and the debugger is not working for Maui-Blazor app in my VS but at the bottom that says unhandled exception Reload
I am also running into a similar issue as well. Wasm works well, but on Maui I get the following chromium error in the android device logs:
Time Device Name Type PID Tag Message
07-02 11:27:14.759 pixel_2_pie_9_0_-_api_28 Info 26807 chromium [INFO:CONSOLE(1)] "Object reference not set to an instance of an object.
at Microsoft.AspNetCore.Components.Routing.Router.Refresh(Boolean isNavigationIntercepted)
at Microsoft.AspNetCore.Components.Routing.Router.SetParametersAsync(ParameterView parameters)", source: https://0.0.0.0/_framework/blazor.webview.js (1)
FYI, I am using authentication in my application and am trying to implement a custom authentication state provider that uses a refresh token stored on the android device (retrieved using WebAuthenticator
Maui Essentials and then calling the token endpoint which works great!) to get the access token. In my Wasm application I am using the Blazor Wasm out of the box oidc services. So slightly different workflow.
Will try to put together a repro later. Thanks!
I am not able to reproduce this.
This is my index.razor:
@inherits ParentComponentBase
@page "/"
<h1>This is the count: @count</h1>
<button @onclick="Increment">Increment</button>
<ul>
<li>1: @_navigation.BaseUri</li>
<li>2: @_jsRuntime.GetType().FullName</li>
</ul>
@code {
int count = 0;
void Increment()
{
count++;
}
}
And this is index.razor.cs:
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
namespace Maui.Controls.Sample.SingleProject.Pages
{
public class ParentComponentBase : ComponentBase
{
[Inject] protected NavigationManager _navigation { get; set; }
[Inject] protected IJSRuntime _jsRuntime { get; set; }
}
public partial class Index : ParentComponentBase
{
}
}
And here it is running on Android:
I am seeing this exception now but in a very different scenario.
Ah, it looks like in my case there's an ambiguous route:
System.InvalidOperationException: 'The following routes are ambiguous:
'/' in 'Maui.Controls.Sample.Pages.Others.Index'
'/' in 'Maui.Controls.Sample.Pages.Index'
'
And it's bubbling up as a super weird exception.
Once I fixed the ambiguous route, the error completely went away.
And as far as that error showing up to begin with, I think that's this Blazor bug: https://github.com/dotnet/aspnetcore/issues/32411
So I'm not aware of any specific issue in Blazor Desktop.
Hi Daniel Roth, The below code is working in blazor hosted wasm
and in Index.razor file
but the same above code is not working in MAUI-Blazor, getting unhandled error in android emulator.