Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Blazored.LocalStorage.js not required? #250

Open
Stuart88 opened this issue Nov 2, 2024 · 5 comments
Open

[Bug] Blazored.LocalStorage.js not required? #250

Stuart88 opened this issue Nov 2, 2024 · 5 comments
Labels
Bug Something isn't working Triage Issue needs to be triaged

Comments

@Stuart88
Copy link

Stuart88 commented Nov 2, 2024

After spending quite a lot of time with this, I think I'm correct in saying that the ReadMe instruction to add the Blazored.LocalStorage.js script to one's project is now obsolete?

Not a bug as such, but a ReadMe bug.

Great library anyway, thanks!

@Stuart88 Stuart88 added Bug Something isn't working Triage Issue needs to be triaged labels Nov 2, 2024
@CoreyHayward
Copy link
Contributor

@Stuart88 This is only required if you wish to use JS Interop Streaming which allows for larger amounts of data to be stored in local storage, see https://github.com/Blazored/LocalStorage?tab=readme-ov-file#using-js-interop-streaming for the details.

When using interactive components in server-side apps JS Interop calls are limited to the configured SignalR message size (default: 32KB). Therefore when attempting to store or retrieve an object larger than this in LocalStorage the call will fail with a SignalR exception.

The following streaming implementation can be used to remove this limit (you will still be limited by the browser).

However, this change is still pending a release to be published to NuGet so unfortunately isn't available yet in v4.5.0 and will need @chrissainty to publish this before it can be used via the package.

@ricardok1
Copy link

Hi @CoreyHayward
With a new WASM project and net9, the Blazored.LocalStorage.js is with 404 on the browser.
I'm "bugged" if we need to include manually or not the file.
On docs doesn't mention this.
Thanks
Ricardo

@CoreyHayward
Copy link
Contributor

CoreyHayward commented Dec 2, 2024

Hi @ricardok1

If you are using the currently available version from NuGet (v4.5.0) then the js file is not a part of this and you can safely exclude it and ignore the steps under the JS Streaming section of the readme.
This section was added as part of the implementation but has not actually been "released" into the package yet unfortunately.

@ricardok1
Copy link

Hi @CoreyHayward
Thanks for the swift reply.
I didn't manually included but appears on the browser automatically so it's inserted by the library.
Thanks
Ricardo

@CoreyHayward
Copy link
Contributor

@ricardok1 Have you compiled the library yourself instead of using NuGet? That's the only way the JS file could be in your project since it's not in the currently released version on NuGet.

What service registration call are you using to setup LocalStorage?

Could you show the full error you're getting and I may be able to help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

3 participants