mrpmorris / Fluxor

Fluxor is a zero boilerplate Flux/Redux library for Microsoft .NET and Blazor.
MIT License
1.29k stars 146 forks source link

Fluxor 6.1.0 throws an exception in Blazor #515

Closed NoahBPeterson closed 3 days ago

NoahBPeterson commented 5 days ago
      Unhandled exception rendering component: PlatformNotSupported_HybridGlobalization, HashCode
System.PlatformNotSupportedException: PlatformNotSupported_HybridGlobalization, HashCode
   at System.Globalization.CompareInfo.GetHashCodeOfStringCore(ReadOnlySpan`1 , CompareOptions )
   at System.Globalization.CompareInfo.GetHashCode(ReadOnlySpan`1 , CompareOptions )
   at System.Globalization.CompareInfo.GetHashCode(String , CompareOptions )
   at System.CultureAwareComparer.GetHashCode(String )
   at System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Fluxor.IFeature, Fluxor, Version=6.1.0.0, Culture=neutral, PublicKeyToken=6e6412da1d5ce8eb]].TryInsert(String , IFeature , InsertionBehavior )
   at System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Fluxor.IFeature, Fluxor, Version=6.1.0.0, Culture=neutral, PublicKeyToken=6e6412da1d5ce8eb]].Add(String key, IFeature value)
   at Fluxor.Store.AddFeature(IFeature feature)
   at Fluxor.DependencyInjection.ServiceRegistration.StoreRegistration.<>c__DisplayClass0_0.<Register>b__2(IServiceProvider serviceProvider)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite , RuntimeResolverContext )
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSiteMain(ServiceCallSite , RuntimeResolverContext )
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite , RuntimeResolverContext , ServiceProviderEngineScope , RuntimeResolverLock )
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite , RuntimeResolverContext )
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSite(ServiceCallSite callSite, RuntimeResolverContext argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite , ServiceProviderEngineScope )
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeServiceProviderEngine.<>c__DisplayClass4_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier , ServiceProviderEngineScope )
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type )
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[Store](IServiceProvider )
   at Fluxor.DependencyInjection.ServiceRegistration.StoreRegistration.<>c.<Register>b__0_1(IServiceProvider serviceProvider)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite , RuntimeResolverContext )
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSiteMain(ServiceCallSite , RuntimeResolverContext )
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite , RuntimeResolverContext , ServiceProviderEngineScope , RuntimeResolverLock )
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite , RuntimeResolverContext )
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSite(ServiceCallSite callSite, RuntimeResolverContext argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite , ServiceProviderEngineScope )
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeServiceProviderEngine.<>c__DisplayClass4_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier , ServiceProviderEngineScope )
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type )
   at Microsoft.AspNetCore.Components.ComponentFactory.<>c__DisplayClass9_0.<CreatePropertyInjector>g__Initialize|1(IServiceProvider serviceProvider, IComponent component)
   at Microsoft.AspNetCore.Components.ComponentFactory.InstantiateComponent(IServiceProvider , Type , IComponentRenderMode , Nullable`1 )
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.InstantiateChildComponentOnFrame(RenderTreeFrame[] , Int32 , Int32 )
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewComponentFrame(DiffContext& , Int32 )
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewSubtree(DiffContext& , Int32 )
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& , Int32 )
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& , Int32 , Int32 , Int32 , Int32 )
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer , RenderBatchBuilder , Int32 , ArrayRange`1 , ArrayRange`1 )
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder , RenderFragment , Exception& )
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry )
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

All usages of Fluxor in my Blazor project:

   Dashboard.Client/Pages/Graph/Graph.razor:@using Fluxor
Dashboard.Client/Pages/Graph/Graph.razor:@inherits Fluxor.Blazor.Web.Components.FluxorComponent
Dashboard.Client/Pages/Main.razor:@using Fluxor
Dashboard.Client/Pages/Main.razor:@inherits Fluxor.Blazor.Web.Components.FluxorComponent
Dashboard.Client/Pages/MeshVizSection/DashHeader.razor:@using Fluxor;
Dashboard.Client/Pages/MeshVizSection/DashHeader.razor:@inherits Fluxor.Blazor.Web.Components.FluxorComponent
Dashboard.Client/Pages/MeshVizSection/SettingsMenu.razor:@using Fluxor
Dashboard.Client/Pages/PageFrame/Sidebar.razor:@using Fluxor
Dashboard.Client/Pages/PageFrame/Sidebar.razor:@inherits Fluxor.Blazor.Web.Components.FluxorComponent
Dashboard.Client/Pages/Sidebar/DeviceDetails/DeviceDetails.razor:@using Fluxor
Dashboard.Client/Pages/Sidebar/DeviceDetails/DeviceDetails.razor:@inherits Fluxor.Blazor.Web.Components.FluxorComponent
Dashboard.Client/Pages/Sidebar/DeviceDetails/DeviceDetailsHeader.razor:@using Fluxor
Dashboard.Client/Pages/Sidebar/DeviceListContainer.razor:@using Fluxor;
Dashboard.Client/Pages/Sidebar/DeviceListContainer.razor:@inherits Fluxor.Blazor.Web.Components.FluxorComponent
Dashboard.Client/Pages/Sidebar/NodeDetails/NodeDetailsContainer.razor:@using Fluxor
Dashboard.Client/Pages/Sidebar/NodeDetails/NodeDetailsContainer.razor:@inherits Fluxor.Blazor.Web.Components.FluxorComponent
Dashboard.Client/Pages/Sidebar/NodeListBlock.razor:@using Fluxor
Dashboard.Client/Pages/Sidebar/NodeListContainer.razor:@using Fluxor
Dashboard.Client/Pages/Sidebar/NodeListContainer.razor:@inherits Fluxor.Blazor.Web.Components.FluxorComponent
Dashboard.Client/Pages/Sidebar/Tabs/TabContainer.razor:@using Fluxor
Dashboard.Client/Pages/Sidebar/Tabs/TabContainer.razor:@inherits Fluxor.Blazor.Web.Components.FluxorComponent
Dashboard.Client/Pages/Sidebar/UnconnectedDevices.razor:@using Fluxor;
Dashboard.Client/Pages/Sidebar/UnconnectedDevices.razor:@inherits Fluxor.Blazor.Web.Components.FluxorComponent
Dashboard.Client/Program.cs:using Fluxor;
Dashboard.Client/Program.cs://builder.Services.AddFluxor(options => options.ScanAssemblies(typeof(Program).Assembly).UseReduxDevTools());
Dashboard.Client/Shared/DetailsHeader.razor:@using Fluxor
Dashboard.Client/Shared/DevicesAccessing.razor:@using Fluxor
Dashboard.Client/Shared/Flyouts/DetailFlyout_Node.razor:@using Fluxor
Dashboard.Client/Shared/Flyouts/DetailFlyout_Node.razor:@inherits Fluxor.Blazor.Web.Components.FluxorComponent
Dashboard.Client/Shared/Flyouts/DeviceFlyout/DetailFlyout_Device.razor:@using Fluxor
Dashboard.Client/Shared/Flyouts/DeviceFlyout/DetailFlyout_Device.razor:@inherits Fluxor.Blazor.Web.Components.FluxorComponent
Dashboard.Client/Shared/Flyouts/FlyoutContainer.razor:@using Fluxor;
Dashboard.Client/Shared/Flyouts/FlyoutContainer.razor:@inherits Fluxor.Blazor.Web.Components.FluxorComponent
Dashboard.Client/Shared/Flyouts/ProtocolFlyout.razor:@using Fluxor;
Dashboard.Client/Shared/ListActionButtons.razor:@using Fluxor
Dashboard.Client/Shared/NodeGraphsContainer.razor:@using Fluxor
Dashboard.Client/Shared/NodeGraphsContainer.razor:@inherits Fluxor.Blazor.Web.Components.FluxorComponent
Dashboard.Client/Shared/Popups/DisconnectDevice/Popup_DisconnectDevice.razor:@using Fluxor
Dashboard.Client/Shared/Popups/NodeLogs/NodeLogsContainer.razor:@using Fluxor
Dashboard.Client/Shared/Popups/NodeLogs/NodeLogsContainer.razor:@inherits Fluxor.Blazor.Web.Components.FluxorComponent
Dashboard.Client/Shared/Popups/NodeLogs/NodeLogsHeader.razor:@using Fluxor
Dashboard.Client/Shared/Popups/NodeLogs/NodeLogsHeader.razor:@inherits Fluxor.Blazor.Web.Components.FluxorComponent
Dashboard.Client/Shared/Popups/NodeLogs/Popup_NodeLogs.razor:@using Fluxor
Dashboard.Client/Shared/Popups/NodePowerOff/Popup_NodePowerOff.razor:@using Fluxor
Dashboard.Client/Shared/Popups/Popup.razor:@using Fluxor;
Dashboard.Client/Shared/Popups/Popup.razor:@inherits Fluxor.Blazor.Web.Components.FluxorComponent
Dashboard.Client/Shared/Searchbar/DeviceFilterFlyout/DeviceFilterFlyout.razor:@using Fluxor
Dashboard.Client/Shared/Searchbar/DeviceFilterFlyout/DeviceFilterFlyout.razor:@inherits Fluxor.Blazor.Web.Components.FluxorComponent
Dashboard.Client/Shared/Searchbar/NodeFilterFlyout.razor/NodeFilterFlyout.razor:@using Fluxor
Dashboard.Client/Shared/Searchbar/NodeFilterFlyout.razor/NodeFilterFlyout.razor:@inherits Fluxor.Blazor.Web.Components.FluxorComponent
Dashboard.Client/Shared/SearchChip/DeviceSearchChipContainer/DeviceSearchChipContainer.razor:@using Fluxor
Dashboard.Client/Shared/SearchChip/DeviceSearchChipContainer/DeviceSearchChipContainer.razor:@inherits Fluxor.Blazor.Web.Components.FluxorComponent
Dashboard.Client/Shared/SearchChip/NodeSearchChipContainer/NodeSearchChipContainer.razor:@using Fluxor
Dashboard.Client/Shared/SearchChip/NodeSearchChipContainer/NodeSearchChipContainer.razor:@inherits Fluxor.Blazor.Web.Components.FluxorComponent
Dashboard.Client/Store/DeviceFilterUserCase/DeviceFilterState.cs:using Fluxor;
Dashboard.Client/Store/DeviceFilterUserCase/Reducer.cs:using Fluxor;
Dashboard.Client/Store/DeviceUseCase/DeviceState.cs:using Fluxor;
Dashboard.Client/Store/DeviceUseCase/Effects.cs:using Fluxor;
Dashboard.Client/Store/DeviceUseCase/Reducer.cs:using Fluxor;
Dashboard.Client/Store/EdgeUseCase/EdgeState.cs:using Fluxor;
Dashboard.Client/Store/EdgeUseCase/Effects.cs:using Fluxor;
Dashboard.Client/Store/EdgeUseCase/Reducer.cs:using Fluxor;
Dashboard.Client/Store/FlyoutUseCase/FlyoutState.cs:using Fluxor;
Dashboard.Client/Store/FlyoutUseCase/Reducer.cs:using Fluxor;
Dashboard.Client/Store/HighlightRouteUseCase/Effects.cs:using Fluxor;
Dashboard.Client/Store/MeshListUseCase/Effects.cs:using Fluxor;
Dashboard.Client/Store/MeshListUseCase/MeshListState.cs:using Fluxor;
Dashboard.Client/Store/MeshListUseCase/Reducer.cs:using Fluxor;
Dashboard.Client/Store/MeshUseCase/Effects.cs:using Fluxor;
Dashboard.Client/Store/MeshUseCase/MeshState.cs:using Fluxor;
Dashboard.Client/Store/MeshUseCase/Reducer.cs:using Fluxor;
Dashboard.Client/Store/NodeFilterUseCase/NodeFilterState.cs:using Fluxor;
Dashboard.Client/Store/NodeFilterUseCase/Reducer.cs:using Fluxor;
Dashboard.Client/Store/NodeUseCase/Effects.cs:using Fluxor;
Dashboard.Client/Store/NodeUseCase/NodeState.cs:using Fluxor;
Dashboard.Client/Store/NodeUseCase/Reducer.cs:using Fluxor;
Dashboard.Client/Store/PopupDisconnectDeviceUseCase/DisconnectDeviceAlertState.cs:using Fluxor;
Dashboard.Client/Store/PopupDisconnectDeviceUseCase/Effects.cs:using Fluxor;
Dashboard.Client/Store/PopupDisconnectDeviceUseCase/Reducer.cs:using Fluxor;
Dashboard.Client/Store/PopupNodeLogUseCase/Effects.cs:using Fluxor;
Dashboard.Client/Store/PopupNodeLogUseCase/NodeLogsState.cs:using Fluxor;
Dashboard.Client/Store/PopupNodeLogUseCase/Reducer.cs:using Fluxor;
Dashboard.Client/Store/PopupNodePowerOffUseCase/Effects.cs:using Fluxor;
Dashboard.Client/Store/PopupNodePowerOffUseCase/NodePowerOffAlertState.cs:using Fluxor;
Dashboard.Client/Store/PopupNodePowerOffUseCase/Reducer.cs:using Fluxor;
Dashboard.Client/Store/PopupUseCase/PopupState.cs:using Fluxor;
Dashboard.Client/Store/PopupUseCase/Reducer.cs:using Fluxor;
Dashboard.Client/Store/SettingsUseCase/Reducer.cs:using Fluxor;
Dashboard.Client/Store/SettingsUseCase/SettingsState.cs:using Fluxor;

Unhandled exception rendering component: PlatformNotSupported_HybridGlobalization, HashCode System.PlatformNotSupportedException: PlatformNotSupported_HybridGlobalization, HashCode

This doesn't occur when building for Debug or Release, only when publishing, which may be compiling ahead of time.

NoahBPeterson commented 3 days ago

After reverting all changes to the last working commit, I built again, and found the issue persisted. I narrowed it down to yet another regression in the .NET SDK that broke Blazor. After creating a global.json that forces the Azure build pipeline to use 8.0.404, it built successfully.

https://learn.microsoft.com/en-us/dotnet/core/tools/global-json https://github.com/dotnet/runtime/issues/109951