question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Writing of objects to local storage broken in 0.1.6 w/ Blazor 0.7.0

See original GitHub issue

Since upgrading to Blazor 0.6.0 to 0.7.0 and from Storage 0.1.5 to 0.1.6, Writing objects directly to local storage seems broken.

i.e. Doing this:

storage.SetItem($"MyAppName.{nameof(MyClassName).ToLower()}", myClassInstance);

in 0.1.5 resulted in something like { \"Id\": 1337 } being saved to storage, where as in 0.1.6 it only writes [object Object] instead. Downgrading back to 0.1.5 (but still with Blazor 0.7.0) works as expected.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ransagycommented, May 8, 2019

@galvesribeiro Confirmed working fine in 0.1.8 + 3.0 preview.5 - Closed.

1reaction
ransagycommented, May 3, 2019

I have yet to update my apps for preview4; It’s proving harder than the previous ones. I’ll try to get to it in the next day or two and report back.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Blazor] localStorage.getItem errors with complex objects
I created a fairly complex object that I want to store in local storage. The object gets set in local storage, but when...
Read more >
How do I read and write to the local storage in Blazor ...
Figured it out. I needed to add it to the OnInitializedAsync() method so everything gets set before the DOM loads.
Read more >
ASP.NET Core Blazor state management
This article describes common approaches for maintaining a user's data (state) while they use an app and across browser sessions. Blazor ...
Read more >
LocalStorage with .NET 6 Blazor WebAssembly - YouTube
Blazor E-Commerce Course: https://www.udemy.com/course/ blazor -ecommerce/?couponCode=YOUTUBE Newsletter: ...
Read more >
Use LocalStorage with Blazor WebAssembly .NET 7 - YouTube
One way to have data persist across sessions in a client-side Blazor WebAssembly application is to write to the browser's LocalStorage or ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found