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
Describe the bug
IJSInProcessRuntime not available is thrown when trying to read from local storage.
Developing a cart where I use OnChange event to update the cart item counter. This have worked before with older .NET version.
To Reproduce
@injectBlazored.LocalStorage.ISyncLocalStorageService LocalStorage
@implements IDisposable
....
privateint GetCartItemCount(){var cart = LocalStorage.GetItem<List<CartItemDto>>("b_cart");// ERROR: IJSInProcessRuntime not availablereturncart!=null?cart.Count:0;}// subscribe to the cart changes eventprotectedoverridevoidOnInitialized(){CartService.OnChange+=StateHasChanged;}publicvoidDispose(){CartService.OnChange-=StateHasChanged;}
After adding items to the cart I invoke the OnChange event.
There were some major changes in how things worked in .NET 8. It sounds like you might need to have a look into them. It sounds to me like you're possibly hitting the pre-rendering scenario.
Describe the bug
IJSInProcessRuntime not available is thrown when trying to read from local storage.
Developing a cart where I use OnChange event to update the cart item counter. This have worked before with older .NET version.
To Reproduce
After adding items to the cart I invoke the OnChange event.
Expected behavior
Counter should be updated with number of items in cart.
Hosting Model (is this issue happening with a certain hosting model?):
The text was updated successfully, but these errors were encountered: