unoplatform / uno

Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.
https://platform.uno
Apache License 2.0
8.76k stars 705 forks source link

[WASM] ReactiveUI's `Activation` and `RoutedViewHost` don't work #2149

Open rdagglis opened 4 years ago

rdagglis commented 4 years ago

Current behavior

When using ReactiveUI's activation or the RoutedViewHost control in a Wasm app, it hangs at the splash screen

Expected behavior

When using ReactiveUI's activation or the RoutedViewHost control in a Wasm app, it should run like it does on the other platforms

How to reproduce it (as minimally and precisely as possible)

I've created a sample project with both errors and instructions:

https://github.com/rdagglis/UnoErrors

Nuget Package: Uno.UI 2.0.512-dev.3683

Affected platform(s):

Visual Studio:

Anything else we need to know?

The details are located in the Readme of the sample project

jeromelaban commented 4 years ago

Thanks for the report! Could you provide a gist with the errors displayed in the browser's debugging console ?

rdagglis commented 4 years ago

Sure. Here are the logs I get when running it in Chrome:

When adding in the RoutedViewHost control

Loaded: Mono.Security.dll
mono.js:1 Loaded: System.Numerics.dll
mono.js:1 Loaded: System.Drawing.Common.dll
mono.js:1 Loaded: System.Net.Http.dll
mono.js:1 Loaded: System.Core.dll
mono.js:1 Loaded: System.Runtime.Serialization.dll
mono.js:1 Loaded: Uno.Xaml.dll
mono.js:1 Loaded: Uno.Foundation.dll
mono.js:1 Loaded: Microsoft.Extensions.Logging.Abstractions.dll
mono.js:1 Loaded: UnoErrors.Wasm.dll
mono.js:1 Loaded: System.Xml.dll
mono.js:1 Loaded: System.dll
mono.js:1 Loaded: Microsoft.Practices.ServiceLocation.dll
mono.js:1 Loaded: Uno.Core.dll
mono.js:1 Loaded: Microsoft.Extensions.Logging.dll
mono.js:1 Loaded: System.Collections.Immutable.dll
mono.js:1 Loaded: ReactiveUI.dll
mono.js:1 Loaded: Uno.dll
mono.js:1 Loaded: Splat.dll
mono.js:1 Loaded: DynamicData.dll
mono.js:1 Loaded: ReactiveUI.Uno.dll
mono.js:1 Loaded: System.Reactive.dll
mono.js:1 Loaded: WebAssembly.Bindings.dll
mono.js:1 Loaded: WebAssembly.Net.WebSockets.dll
mono.js:1 Loaded: Uno.UI.Wasm.dll
mono.js:1 Loaded: WebAssembly.Net.Http.dll
mono.js:1 Loaded: mscorlib.dll
mono.js:1 Loaded: Uno.UI.dll
mono.js:1 initializing mono runtime
mono.js:1 >>mono_wasm_runtime_ready
mono.js:1 LogHost: Initializing to normal mode
mono.js:1 LogHost: It seems you are running .NET Standard, but there is no host package installed!
mono.js:1 
mono.js:1 LogHost: You will need to install the specific host package for your platform (ReactiveUI.WPF, ReactiveUI.Blazor, ...)
mono.js:1 
mono.js:1 LogHost: You can install the needed package via NuGet, see https://reactiveui.net/docs/getting-started/installation/
mono.js:1 RoutedViewHost: Couldn't find an IPlatformOperations implementation. Please make sure you have installed the latest version of the ReactiveUI packages for your platform. See https://reactiveui.net/docs/getting-started/installation for guidance.
rdagglis commented 4 years ago

When including the activation code

Loaded: Mono.Security.dll
mono.js:1 Loaded: System.Numerics.dll
mono.js:1 Loaded: System.Drawing.Common.dll
mono.js:1 Loaded: System.Net.Http.dll
mono.js:1 Loaded: System.Core.dll
mono.js:1 Loaded: System.Runtime.Serialization.dll
mono.js:1 Loaded: Uno.Xaml.dll
mono.js:1 Loaded: Uno.Foundation.dll
mono.js:1 Loaded: Microsoft.Extensions.Logging.Abstractions.dll
mono.js:1 Loaded: UnoErrors.Wasm.dll
mono.js:1 Loaded: System.dll
mono.js:1 Loaded: System.Xml.dll
mono.js:1 Loaded: Microsoft.Practices.ServiceLocation.dll
mono.js:1 Loaded: Microsoft.Extensions.Logging.dll
mono.js:1 Loaded: Uno.Core.dll
mono.js:1 Loaded: System.Collections.Immutable.dll
mono.js:1 Loaded: Splat.dll
mono.js:1 Loaded: Uno.dll
mono.js:1 Loaded: ReactiveUI.dll
mono.js:1 Loaded: System.Reactive.dll
mono.js:1 Loaded: ReactiveUI.Uno.dll
mono.js:1 Loaded: DynamicData.dll
mono.js:1 Loaded: WebAssembly.Net.Http.dll
mono.js:1 Loaded: WebAssembly.Bindings.dll
mono.js:1 Loaded: WebAssembly.Net.WebSockets.dll
mono.js:1 Loaded: Uno.UI.Wasm.dll
mono.js:1 Loaded: mscorlib.dll
mono.js:1 Loaded: Uno.UI.dll
mono.js:1 initializing mono runtime
mono.js:1 >>mono_wasm_runtime_ready
mono.js:1 LogHost: Initializing to normal mode
mono.js:1 LogHost: It seems you are running .NET Standard, but there is no host package installed!
mono.js:1 
mono.js:1 LogHost: You will need to install the specific host package for your platform (ReactiveUI.WPF, ReactiveUI.Blazor, ...)
mono.js:1 
mono.js:1 LogHost: You can install the needed package via NuGet, see https://reactiveui.net/docs/getting-started/installation/
jeromelaban commented 4 years ago

Interesting... Does this sample work for you?

rdagglis commented 4 years ago

Unfortunately no. I downdloaded the zip, ran as is, and I see the RoutedViewHost error. This is my log in Chrome:

Setting UNO_BOOTSTRAP_MONO_RUNTIME_MODE=Interpreter
uno-bootstrap.js:11 Setting UNO_BOOTSTRAP_LINKER_ENABLED=True
uno-bootstrap.js:11 Setting UNO_BOOTSTRAP_DEBUGGER_ENABLED=True
uno-bootstrap.js:11 Setting UNO_BOOTSTRAP_MONO_RUNTIME_CONFIGURATION=release
mono.js:1 Loaded: System.Core.pdb
mono.js:1 Loaded: Mono.Security.pdb
mono.js:1 Loaded: ReactiveUI.UwpRouting.Wasm.pdb
mono.js:1 Loaded: Mono.Security.dll
mono.js:1 Loaded: System.Numerics.pdb
mono.js:1 Loaded: System.Net.Http.pdb
mono.js:1 Loaded: System.Drawing.Common.pdb
mono.js:1 Loaded: System.Numerics.dll
mono.js:1 Loaded: System.Drawing.Common.dll
mono.js:1 Loaded: System.Net.Http.dll
mono.js:1 Loaded: System.Core.dll
mono.js:1 Loaded: System.Runtime.Serialization.dll
mono.js:1 Loaded: Uno.Foundation.dll
mono.js:1 Loaded: System.Runtime.Serialization.pdb
mono.js:1 Loaded: System.pdb
mono.js:1 Loaded: System.Xml.pdb
mono.js:1 Loaded: Uno.Xaml.dll
mono.js:1 Loaded: mscorlib.pdb
mono.js:1 Loaded: ReactiveUI.UwpRouting.Wasm.dll
mono.js:1 Loaded: System.Xml.dll
mono.js:1 Loaded: System.dll
mono.js:1 Loaded: Uno.UI.pdb
mono.js:1 Loaded: mscorlib.dll
mono.js:1 Loaded: Microsoft.Practices.ServiceLocation.dll
mono.js:1 Loaded: Microsoft.Extensions.Logging.dll
mono.js:1 Loaded: System.Collections.Immutable.dll
mono.js:1 Loaded: Uno.Core.dll
mono.js:1 Loaded: Microsoft.Extensions.Logging.Abstractions.dll
mono.js:1 Loaded: Uno.Foundation.pdb
mono.js:1 Loaded: Uno.UI.dll
mono.js:1 Loaded: Splat.dll
mono.js:1 Loaded: Uno.pdb
mono.js:1 Loaded: DynamicData.dll
mono.js:1 Loaded: Uno.dll
mono.js:1 Loaded: Uno.UI.Wasm.pdb
mono.js:1 Loaded: Microsoft.Extensions.Logging.Filter.dll
mono.js:1 Loaded: ReactiveUI.Uno.dll
mono.js:1 Loaded: System.Reactive.Wasm.dll
mono.js:1 Loaded: Microsoft.Extensions.Logging.Console.dll
mono.js:1 Loaded: ReactiveUI.dll
mono.js:1 Loaded: System.Reactive.dll
mono.js:1 Loaded: Uno.UI.Wasm.dll
mono.js:1 Loaded: WebAssembly.Net.Http.dll
mono.js:1 Loaded: WebAssembly.Net.Http.pdb
mono.js:1 Loaded: WebAssembly.Net.WebSockets.dll
mono.js:1 Loaded: WebAssembly.Bindings.dll
mono.js:1 Loaded: WebAssembly.Bindings.pdb
mono.js:1 Loaded: WebAssembly.Net.WebSockets.pdb
mono.js:1 initializing mono runtime
mono.js:1 DEBUGGING ENABLED
mono.js:1 >>mono_wasm_runtime_ready
uno-bootstrap.js:362 Done loading the BCL
uno-bootstrap.js:377 Loading dependency (jquery-pep)
uno-bootstrap.js:377 Loading dependency (setImmediate)
uno-bootstrap.js:377 Loading dependency (Uno.UI)
uno-bootstrap.js:377 Loading dependency (jquery-pep)
uno-bootstrap.js:377 Loading dependency (setImmediate)
uno-bootstrap.js:377 Loading dependency (Uno.UI)
uno-bootstrap.js:377 Loading dependency (AppManifest)
uno-bootstrap.js:370 Loaded dependency (Uno.UI)
uno-bootstrap.js:442 Debugging hotkey: Shift+Alt+D (when application has focus)
mono.js:1 fail: Windows.UI.Xaml.UIElement[0]
mono.js:1       The member event PointerEventHandler UIElement.PointerWheelChanged is not implemented in Uno.
mono.js:1 RoutedViewHost: Couldn't find an IPlatformOperations implementation. Please make sure you have installed the latest version of the ReactiveUI packages for your platform. See https://reactiveui.net/docs/getting-started/installation for guidance.
mono.js:1 WASM doesn't support threading
mono.js:1 fail: Windows.UI.Core.CoreDispatcher[0]
mono.js:1       Dispatcher unhandled exception
mono.js:1 System.Exception: Failed to load Page ReactiveUI.UwpRouting.Views.MainView
mono.js:1   at ReactiveUI.UwpRouting.App.OnNavigationFailed (System.Object sender, Windows.UI.Xaml.Navigation.NavigationFailedEventArgs e) [0x00001] in C:\Users\rdag\Downloads\ReactiveUI.Samples-master\uno\ReactiveUI.UwpRouting.Shared\App.xaml.cs:72 
mono.js:1   at (wrapper delegate-invoke) <Module>.invoke_void_object_NavigationFailedEventArgs(object,Windows.UI.Xaml.Navigation.NavigationFailedEventArgs)
mono.js:1   at Windows.UI.Xaml.Controls.Frame.InnerNavigate (Windows.UI.Xaml.Navigation.PageStackEntry entry, Windows.UI.Xaml.Navigation.NavigationMode mode) [0x001c0] in D:\a\1\s\src\Uno.UI\UI\Xaml\Controls\Frame\Frame.cs:339 
mono.js:1   at Windows.UI.Xaml.Controls.Frame.Navigate (System.Type sourcePageType, System.Object parameter, Windows.UI.Xaml.Media.Animation.NavigationTransitionInfo infoOverride) [0x00009] in D:\a\1\s\src\Uno.UI\UI\Xaml\Controls\Frame\Frame.cs:242 
mono.js:1   at Windows.UI.Xaml.Controls.Frame.Navigate (System.Type sourcePageType, System.Object parameter) [0x00000] in D:\a\1\s\src\Uno.UI\UI\Xaml\Controls\Frame\Frame.cs:237 
mono.js:1   at ReactiveUI.UwpRouting.App.OnLaunched (Windows.ApplicationModel.Activation.LaunchActivatedEventArgs e) [0x00069] in C:\Users\rdag\Downloads\ReactiveUI.Samples-master\uno\ReactiveUI.UwpRouting.Shared\App.xaml.cs:61 
mono.js:1   at Windows.UI.Xaml.Application.Initialize () [0x0004f] in D:\a\1\s\src\Uno.UI\UI\Xaml\Application.wasm.cs:68 
mono.js:1   at (wrapper delegate-invoke) <Module>.invoke_void()
mono.js:1   at Windows.UI.Core.CoreDispatcher.DispatchItems () [0x000c6] in D:\a\1\s\src\Uno.UWP\UI\Core\CoreDispatcher.cs:262 

error

jeromelaban commented 4 years ago

It looks like something is trying to use threads. Did you update the logging packages or used the 1.1.1 version ?

rdagglis commented 4 years ago

I'll verify and report back as soon as I can. 👍

rdagglis commented 4 years ago

Sorry for the delay. I basically downloaded the sample from your link. This is the nuget package list I have:

nuget