xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.64k stars 1.88k forks source link

[Bug] WebView on UWP cannot load any Grafana 8.x and 9.x dashboards (XBox, HL and Windows) #15389

Open muenchris opened 2 years ago

muenchris commented 2 years ago

Description

Any loading of a 8.x and 9.x Grafana screen in WebView on UWP (XBox/HL/Windows) shows "If you're seeing this Grafana has failed to load its application files"

Steps to Reproduce

  1. Add a WebView to a Xamarin Forms app and point at a Grafana Screen (does not matter if home-screen or a dasboard)
  2. Launch the app on Windows or XBox
  3. Screen only shows error message

Expected Behavior

Screen should load normally (WebView2 loads Grafana correctly but does not work in Xamarin)

Actual Behavior

Error message is visible

Basic Information

Environment

Show/Hide Visual Studio info ``` Microsoft Visual Studio Enterprise 2022 Version 17.2.2 VisualStudio.17.Release/17.2.2+32519.379 Microsoft .NET Framework Version 4.8.09032 Installed Version: Enterprise Architecture Diagrams and Analysis Tools 00476-80000-00000-AA098 Microsoft Architecture Diagrams and Analysis Tools Visual C++ 2022 00476-80000-00000-AA098 Microsoft Visual C++ 2022 .NET Core Debugging with WSL 1.0 .NET Core Debugging with WSL ADL Tools Service Provider 1.0 This package contains services used by Data Lake tools ASA Service Provider 1.0 ASP.NET and Web Tools 2019 17.2.389.42256 ASP.NET and Web Tools 2019 Azure App Service Tools v3.0.0 17.2.389.42256 Azure App Service Tools v3.0.0 Azure Data Lake Tools for Visual Studio 2.6.5000.0 Microsoft Azure Data Lake Tools for Visual Studio Azure Functions and Web Jobs Tools 17.2.389.42256 Azure Functions and Web Jobs Tools Azure Stream Analytics Tools for Visual Studio 2.6.5000.0 Microsoft Azure Stream Analytics Tools for Visual Studio C# Tools 4.2.0-4.22252.24+47cdc16a21bbb8a4aadfb666b011e2059e1be5d2 C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools. Cookiecutter 17.0.22089.1 Provides tools for finding, instantiating and customizing templates in cookiecutter format. Extensibility Message Bus 1.2.6 (master@34d6af2) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration. GitExtensions 1.0 Git Extensions is a graphical user interface for Git that allows you to control Git without using the command-line Microsoft Azure Hive Query Language Service 2.6.5000.0 Language service for Hive query Microsoft Azure Stream Analytics Language Service 2.6.5000.0 Language service for Azure Stream Analytics Microsoft Azure Tools for Visual Studio 2.9 Support for Azure Cloud Services projects Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines Mono Debugging for Visual Studio 17.2.20 (482eb2a) Support for debugging Mono processes with Visual Studio. Node.js Tools 1.5.40404.3 Commit Hash:dd524a7d0ee653de8b7b32a93ca22f2d57cd2419 Adds support for developing and debugging Node.js apps in Visual Studio NuGet Package Manager 6.2.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/ Office Developer Tools for Visual Studio 17.0.32314.00 Microsoft Office Developer Tools for Visual Studio Python - Profiling support 17.0.22089.1 Profiling support for Python projects. Python with Pylance 17.0.22089.1 Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers. Razor (ASP.NET Core) 17.0.0.2218101+885a343b00bcab620a90c1550c37dafd730ce984 Provides languages services for ASP.NET Core Razor. SQL Server Data Tools 17.0.62204.01010 Microsoft SQL Server Data Tools ToolWindowHostedEditor 1.0 Hosting json editor into a tool window TypeScript Tools 17.0.10418.2001 TypeScript Tools for Microsoft Visual Studio Visual Basic Tools 4.2.0-4.22252.24+47cdc16a21bbb8a4aadfb666b011e2059e1be5d2 Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Visual F# Tools 17.1.0-beta.22253.3+058e7a7e597a02c129f38742f250a4b212da9ee3 Microsoft Visual F# Tools Visual Studio IntelliCode 2.2 AI-assisted development for Visual Studio. Visual Studio Tools for Unity 17.2.3.0 Visual Studio Tools for Unity VisualStudio.DeviceLog 1.0 Information about my package VisualStudio.Mac 1.0 Mac Extension for Visual Studio VSPackage Extension 1.0 VSPackage Visual Studio Extension Detailed Info Web Compiler 1.14.8 Compiler for LESS, Sass and CoffeeScript files WiX Toolset Visual Studio Extension 1.0.0.18 WiX Toolset Visual Studio Extension version 1.0.0.18 Copyright (c) .NET Foundation and contributors. All rights reserved. Workflow Manager Tools 1.0 1.0 This package contains the necessary Visual Studio integration components for Workflow Manager. Xamarin 17.2.0.175 (d17-2@e4ffdc0) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android. Xamarin Designer 17.2.0.244 (remotes/origin/d17-2@197e1a0b7) Visual Studio extension to enable Xamarin Designer tools in Visual Studio. Xamarin Templates 17.2.15 (2e3b60e) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms. Xamarin.Android SDK 12.3.0.3 (d17-2/bbba5a2) Xamarin.Android Reference Assemblies and MSBuild support. Mono: adf1bc4 Java.Interop: xamarin/java.interop/d17-2@9760f0a9 ProGuard: Guardsquare/proguard/v7.0.1@912d149 SQLite: xamarin/sqlite/3.38.2@7b1e016 Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-2@fc3c2ac Xamarin.iOS and Xamarin.Mac SDK 15.10.0.1 (568bdb24e) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support. ```

Build Logs

Screenshots

image

Reproduction Link

Any Grafana 8.x and 9.x Dashboard

Workaround

Not found yet

jfversluis commented 2 years ago

Screen should load normally (WebView2 loads Grafana correctly but does not work in Xamarin)

We're not using WebView2 but WebView, so that is probably why :)

Could you use the Edge Developer Tools to inspect the console output for any more information that gives?

muenchris commented 2 years ago

I know that you do not use WebView2 - WebView2 does not work on XBox at all (no runtime found). if I debug the script with Visual Studio one of the Grafana JavaScript libraries throws an error. I will try to find out exactly what object fails to create. Grafana then "thinks" its runtime could not be instantiated correctly and shows the error message. The error above is very easy to reproduce on Windows. Just try to load any Grafana 8.6 or 9.0 screen in the WebView of an Windows Xamarin Forms app.

muenchris commented 1 year ago

This same issue happens on TizenOS. I posted this issue with Grafanalabs but they came back saying that they will not fix it (only support for latest browsers). Not a good answer as many factory breakrooms and displays are using the Samsung Smart TV Browser to monitor Factory KPIs in Grafana. I will keep pushing them to fix it :)