You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After deploying recent changes to production—including DLL version upgrades—we encountered an intermittent StoreInitializationException. The error occurred once per session and did not reappear after a page refresh. My suspicion is that the issue may lie in the way Blazor executes component, route, and page lifecycles during render mode transitions when DLL and WASM upgrades occur. This behavior could explain why the problem does not recur once the DLLs have been updated for that browser/context.
Due to the unique nature of this scenario, I was unable to reproduce the error in either a sample project or in the original development environment where it was first observed.
Error Details
Error Message:
Store initialization error: An attempt was made to transition a task to a final state when it had already completed.
Formatted Message:
Unhandled exception rendering component: Store initialization error
Call Stack:
Fluxor.Exceptions.StoreInitializationException:
at Fluxor.Blazor.Web.StoreInitializer+<OnAfterRenderAsync>d__17.MoveNext (Fluxor.Blazor.Web, Version=6.6.0.0, Culture=neutral, PublicKeyToken=null: D:\a\Fluxor\Fluxor\Source\Lib\Fluxor.Blazor.Web\StoreInitializer.cs:102)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Microsoft.AspNetCore.Components.RenderTree.Renderer+<GetErrorHandledTask>d__89.MoveNext (Microsoft.AspNetCore.Components, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
Inner exception System.InvalidOperationException handled at Fluxor.Blazor.Web.StoreInitializer+<OnAfterRenderAsync>d__17.MoveNext:
at System.ThrowHelper.ThrowInvalidOperationException (System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Fluxor.Store+<ActivateStoreAsync>d__39.MoveNext (Fluxor, Version=6.6.0.0, Culture=neutral, PublicKeyToken=null: D:\a\Fluxor\Fluxor\Source\Lib\Fluxor\Store.cs:270)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Fluxor.Store+<InitializeAsync>d__25.MoveNext (Fluxor, Version=6.6.0.0, Culture=neutral, PublicKeyToken=null: D:\a\Fluxor\Fluxor\Source\Lib\Fluxor\Store.cs:115)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Fluxor.Blazor.Web.StoreInitializer+<OnAfterRenderAsync>d__17.MoveNext (Fluxor.Blazor.Web, Version=6.6.0.0, Culture=neutral, PublicKeyToken=null: D:\a\Fluxor\Fluxor\Source\Lib\Fluxor.Blazor.Web\StoreInitializer.cs:87)
Relevant Code Location:
The error appears to be triggered in Store.cs at line 270:
InitializedCompletionSource.SetResult(true);
Context and Reproduction
Deployment Changes:
The error surfaced after pushing updates to production that involved DLL version upgrades.
Environment:
The application uses Blazor with AutoRender mode, which transitions automatically from server to WebAssembly. It appears that the error might be linked to the timing of DLL and WASM updates during the transition.
Behavior Observed:
The error occurred once during a session.
Refreshing the page resolved the issue permanently in that session.
The behavior was consistent across different browsers and application contexts where the application was preloaded.
Proposed Change
It is suggested to modify the code from:
InitializedCompletionSource.SetResult(true);
to:
InitializedCompletionSource.TrySetResult(true);
Note: Further investigation is recommended to assess any potential impact of this change.
Additional Information
Please let me know if further details or logs are required. I am available to help with additional investigation.
The text was updated successfully, but these errors were encountered:
Summary
After deploying recent changes to production—including DLL version upgrades—we encountered an intermittent
StoreInitializationException
. The error occurred once per session and did not reappear after a page refresh. My suspicion is that the issue may lie in the way Blazor executes component, route, and page lifecycles during render mode transitions when DLL and WASM upgrades occur. This behavior could explain why the problem does not recur once the DLLs have been updated for that browser/context.Due to the unique nature of this scenario, I was unable to reproduce the error in either a sample project or in the original development environment where it was first observed.
Error Details
Error Message:
Store initialization error: An attempt was made to transition a task to a final state when it had already completed.
Exception Type:
System.InvalidOperationException
Failed Method:
Fluxor.Store+<ActivateStoreAsync>d__39.MoveNext
Problem Identifier:
System.InvalidOperationException
atFluxor.Store+<ActivateStoreAsync>d__39.MoveNext
Assembly Details:
System.ThrowHelper.ThrowInvalidOperationException
Formatted Message:
Unhandled exception rendering component: Store initialization error
Call Stack:
The error appears to be triggered in Store.cs at line 270:
Context and Reproduction
Deployment Changes:
The error surfaced after pushing updates to production that involved DLL version upgrades.
Environment:
The application uses Blazor with AutoRender mode, which transitions automatically from server to WebAssembly. It appears that the error might be linked to the timing of DLL and WASM updates during the transition.
Behavior Observed:
Proposed Change
It is suggested to modify the code from:
to:
Note: Further investigation is recommended to assess any potential impact of this change.
Additional Information
Please let me know if further details or logs are required. I am available to help with additional investigation.
The text was updated successfully, but these errors were encountered: