tryphotino / photino.Blazor

https://tryphotino.io
Apache License 2.0
324 stars 62 forks source link

All Sample Apps Stuck on "Loading..." on MacOS #124

Closed scottkuhl closed 3 weeks ago

scottkuhl commented 1 month ago

When running or debugging any of the sample apps, they all get stuck on the loading screen.

Photino.NET: "Photino".SetTitle(Photino.Blazor App)
Photino.NET: "Photino.Blazor App".SetUseOsDefaultSize(False)
Photino.NET: "Photino.Blazor App".SetUseOsDefaultLocation(False)
Photino.NET: "Photino.Blazor App".SetWidth(1000)
Photino.NET: "Photino.Blazor App".SetHeight(900)
Photino.NET: "Photino.Blazor App".SetLeft(0)
Photino.NET: "Photino.Blazor App".SetTop(100)
Photino.NET: "Photino.Blazor App".SetIconFile(favicon.ico)
Photino.NET: "Photino.Blazor App".SetTitle(Photino Hello World)
Photino.NET: "Photino Hello World".Load(/)
Photino.NET: "Photino Hello World" ** File "/" could not be found.
Photino.NET: "Photino Hello World".Load(app://localhost/)
2024-07-13 12:23:15.337 HelloWorld[13772:1890879] void * _Nullable NSMapGet(NSMapTable * _Nonnull, const void * _Nullable): map table argument is NULL
Photino.NET: "Photino Hello World".SendWebMessage(__bwv:["BeginInvokeJS",2,"Blazor._internal.attachWebRendererInterop","[3,{\u0022__dotNetObject\u0022:1},{},{}]",3,0])
Photino.NET: "Photino Hello World".SendWebMessage(__bwv:["AttachToDocument",0,"app"])
Photino.NET: "Photino Hello World".SendWebMessage(__bwv:["RenderBatch",1,"AAAAAAEAAAABAAAAAAAAAAAAAAD/////AQAAAAAAAAANAAAAAQAAAA0AAAAAAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAAAAAAAAAAAAgAAAAMAAAAAAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAAAAAAAAAAAAEAAAADAAAABQAAAAAAAAAAAAAAAgAAAAYAAAAAAAAAAAAAAAAAAAACAAAABwAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAAAAAAAQAAAAQAAAAJAAAAAAAAAAAAAAADAAAACgAAAAsAAAAAAAAAAAAAAAMAAAAMAAAA/////wEAAAAAAAAAAgAAAA0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANkaXYCaDEVSGVsbG8gUGhvdGluby5CbGF6b3IhASEGCgogICAgAXAPQ3VycmVudCBjb3VudDogATAGCgogICAgBmJ1dHRvbgVjbGFzcw9idG4gYnRuLXByaW1hcnkHb25jbGljawhDbGljayBtZTABAAA0AQAANwEAAE0BAABPAQAAVgEAAFgBAABoAQAAagEAAHEBAAB4AQAAfgEAAI4BAACWAQAAGAAAACAAAAAoAQAALAEAAJ8BAAA="])

.NET Version: 8.0.6 OS: macOS Sonoma 14.5

thatplatypus commented 1 month ago

I downgraded to 2.6.0 after reading another one of the issues on the linux thread suggested it could work there but not in V3. This actually worked for me as well after manually adding a reference to the webview.

My specs look the same as yours

.NET Version: 8.0.6 OS: macOS Sonoma 14.5

scottkuhl commented 1 month ago

@thatplatypus are you saying you downgraded to 2.6 and added a reference to the web view?

Could you post the code changes you made to get them working?

thatplatypus commented 1 month ago
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk.Razor">
    <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net8.0</TargetFramework>
        <ImplicitUsings>enable</ImplicitUsings>
        <Nullable>enable</Nullable>
        <PublishTrimmed>False</PublishTrimmed>
    </PropertyGroup>
    <ItemGroup>
        <SupportedPlatform Include="browser" />
    </ItemGroup>
    <ItemGroup>
        <PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.6" />
        <PackageReference Include="Microsoft.AspNetCore.Components" Version="8.0.7" />
        <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
        <PackageReference Include="Photino.Blazor" Version="2.6.0" /> /*Downgraded*/
        <PackageReference Include="Microsoft.AspNetCore.Components.WebView" Version="8.0.6" /> /*Manually added*/
    </ItemGroup>
    <ItemGroup>
        <Content Update="wwwroot\**">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Content>
    </ItemGroup>

Here's the updated csproj for my Photino app. I put a comment next to the two things I changed manually, downgrading photino then adding a reference to the web view. Without the reference for the web view there was an exception being thrown otherwise about not having some service, and googling that led me to add the reference.

It's a relatively "standard" setup where the Photino app is a thin host for a RCL of components in a separate csproj, with the photino app implementing any of the services needed for the UI. Got 3rd party component libraries working this way too so should be pretty suitable.

scottkuhl commented 1 month ago

So, this is a nice workaround by downgrading, but the Sample apps and the Photino.Blazor project still need a fix.

scottkuhl commented 1 month ago

@MikeYeager @philippjbauer or @ottodobretsberger any guidance on what this may be?

MikeYeager commented 3 weeks ago

@scottkuhl We are currently updating the samples for the latest Photino release. We will test as part of that process.

MikeYeager commented 3 weeks ago

@scottkuhl We have just published Photino.Blazor v3.1.8. Please give it a try. Re-open if you have issues. thanks!

thatplatypus commented 3 weeks ago

For me this worked, upgraded all my packages to 8.0.8 and photino to the latest this morning. Visual studio needed the latest updates too (or maybe just a restart) but after that build / run on my project made it run as expected 😄

Thank you all for your work on this!

MikeYeager commented 3 weeks ago

@thatplatypus Thank you for the confirmation! We're so glad to finally get these fixes posted. We'll tackle updating the samples next.

scottkuhl commented 3 weeks ago

@MikeYeager please post a comment here when the sample apps are updated, since that is what the original issue was about. I thought based on your comment yesterday when the issue was closed you were referring to the samples. Thanks.