There has been an issue with clicking the Register Link on the default Blazer WASM project using Authentication and ASP.NET Core hosted since Authentication was introduced in Blazer WASM. Today, I came to understand the discrepancy, and why you guys could not duplicate it which I will answer below. Here is the error.
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Invalid calling object
TypeError: Invalid calling object
at Anonymous function (https://localhost:44321/_framework/blazor.webassembly.js:1:9866)
at Promise (native code)
at e.jsCallDispatcher.beginInvokeJSFromDotNet (https://localhost:44321/_framework/blazor.webassembly.js:1:9835)
at _mono_wasm_invoke_js_marshalled (https://localhost:44321/_framework/wasm/dotnet.3.2.0-rc1.20222.2.js:1:171315)
at Module[_mono_wasm_invoke_method] (https://localhost:44321/_framework/wasm/dotnet.3.2.0-rc1.20222.2.js:1:195702)
at BINDING.call_method (https://localhost:44321/_framework/wasm/dotnet.3.2.0-rc1.20222.2.js:1:160862)
at Anonymous function (https://localhost:44321/_framework/wasm/dotnet.3.2.0-rc1.20222.2.js:1:163131)
at beginInvokeDotNetFromJS (https://localhost:44321/_framework/blazor.webassembly.js:1:41356)
at s (https://localhost:44321/_framework/blazor.webassembly.js:1:8558)
at e.invokeMethodAsync (https://localhost:44321/_framework/blazor.webassembly.js:1:9634)
Microsoft.JSInterop.JSException: Invalid calling object
TypeError: Invalid calling object
at Anonymous function (https://localhost:44321/_framework/blazor.webassembly.js:1:9866)
at Promise (native code)
at e.jsCallDispatcher.beginInvokeJSFromDotNet (https://localhost:44321/_framework/blazor.webassembly.js:1:9835)
at _mono_wasm_invoke_js_marshalled (https://localhost:44321/_framework/wasm/dotnet.3.2.0-rc1.20222.2.js:1:171315)
at Module[_mono_wasm_invoke_method] (https://localhost:44321/_framework/wasm/dotnet.3.2.0-rc1.20222.2.js:1:195702)
at BINDING.call_method (https://localhost:44321/_framework/wasm/dotnet.3.2.0-rc1.20222.2.js:1:160862)
at Anonymous function (https://localhost:44321/_framework/wasm/dotnet.3.2.0-rc1.20222.2.js:1:163131)
at beginInvokeDotNetFromJS (https://localhost:44321/_framework/blazor.webassembly.js:1:41356)
at s (https://localhost:44321/_framework/blazor.webassembly.js:1:8558)
at e.invokeMethodAsync (https://localhost:44321/_framework/blazor.webassembly.js:1:9634)
at System.Threading.Tasks.ValueTask`1[TResult].get_Result () in :0
at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync (Microsoft.JSInterop.IJSRuntime jsRuntime, System.String identifier, System.Object[] args) in :0
at Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticatorViewCore`1[TAuthenticationState].OnParametersSetAsync () in :0
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion (System.Threading.Tasks.Task task) in :0
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync () in :0
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask (System.Threading.Tasks.Task taskToHandle) in :0
blazor.webassembly.js (1,37753)
When I install Windows 10 v. 1909, and perform all needed Windows Updates, and I install VS 2019 v16.6 updated to Preview 5, and install the latest Blazor WASM,… at no time was I made aware that my version of MS Edge was not sufficient, or that I needed to download a newer version of Microsoft Edge. Yes… I remember reading that I needed a Chromium based browser such as MS Edge, but that didn’t inform me that my version was inadequate. That just told me that if I had MS Edge, I was “good to go”. By default… most everyone in my company will not have updated to the new version of MS Edge if it isn’t part of a Windows Update… and trust me… I assumed because there were no updates available, I had the latest. I was running:
Microsoft Edge 44.18362.449.0
Microsoft EdgeHTML 18.18363
When I UPDATED to Version 81.0.416.68 (Official build) (64-bit), the problem I have been having went away.
Create a new VM using Windows 10 v 1909, and perform all Windows Updates. Install VS 2019 v16.6 Preview 5, and the RC of WASM. Create WASM project with Authentication and ASP.NET Core hosted options... then Run (F5 - Debug) using the default... IIS Express and MS Edge. Click on the [Register] link at the top. The error occurs without taking you to the Register page. The [Login] link works fine.
Thanks for contacting us.
@javiercn can you please look into this? Thanks!
Thanks for the report, @wbalzer.
Just noticed that you've got this resolved by upgrading to a later Edge version.
@javiercn and @mkArtakMSFT
Why did you close this? The problem isn't resolved just because I upgraded to the NEW Edge. The problem is that because EVERYONE ELSE is still running a legacy version of Edge in the LATEST version of Windows 10, and Windows UPDATE, then I cannot assume any of my users will have the NEW Edge installed. If you are not going to support the Legacy Edge browser, then SOMEWHERE in the documentation, you need to make that clear. If it was clear, I would not have wasted a month trying to make the Legacy Edge to work thinking it was my problem because nobody could reproduce the error.
I have reported the error with the details specific to reproducing the error with a current, but legacy version of MS Edge which I am assuming you are going to support unless otherwise noted.
I have the same problem when running on Edge. This doesn't look closed to me.
I'm having this problem with Chrome. I just updated to the latest CR1. I must have missed some upgrade instructions somewhere because I'm broke now. Still researching...
I get the "same" error when trying to navigate to /authentication/profile when using "legacy" Edge.
Thanks for contacting us. Per our support policy we support current versions of major browsers: https://docs.microsoft.com/en-us/aspnet/core/blazor/supported-platforms?view=aspnetcore-3.1
Closing as there are no further actions pending here.
Most helpful comment
@javiercn and @mkArtakMSFT
Why did you close this? The problem isn't resolved just because I upgraded to the NEW Edge. The problem is that because EVERYONE ELSE is still running a legacy version of Edge in the LATEST version of Windows 10, and Windows UPDATE, then I cannot assume any of my users will have the NEW Edge installed. If you are not going to support the Legacy Edge browser, then SOMEWHERE in the documentation, you need to make that clear. If it was clear, I would not have wasted a month trying to make the Legacy Edge to work thinking it was my problem because nobody could reproduce the error.
I have reported the error with the details specific to reproducing the error with a current, but legacy version of MS Edge which I am assuming you are going to support unless otherwise noted.