Storage
Storage copied to clipboard
Could not find 'BlazorExtensions' in 'window' (*Client* mode)
BlazorExtensions/Storage 1.1.0-preview3 issue:
Similar to issue #35 "Could not find 'BlazorExtensions' in 'window' (Server mode)", but client side:
After updating from ASP .NET 3.0 to latest 3.1 Microsoft.AspNetCore.Blazor (3.1.0-preview4.19579.2), I had to change the injection to the related interfaces to compile:
using Blazor.Extensions.Storage; using Blazor.Extensions.Storage.Interfaces;
The first "using" statement seems not necessary any more.
And injection also changed from the class "SessionStorage" to the new interface style "ISessionStorage": [Inject] protected ISessionStorage SessionStorage { get; set; }
But after compiling successfully, I also receive the following exception (similar to server side issue):
WASM: Microsoft.JSInterop.JSException: Could not find 'BlazorExtensions' in 'window'. blazor.webassembly.js:1:35158
printErr http://localhost:58811/_framework/blazor.webassembly.js:1
put_char http://localhost:58811/_framework/wasm/mono.js:1
write http://localhost:58811/_framework/wasm/mono.js:1
write http://localhost:58811/_framework/wasm/mono.js:1
doWritev http://localhost:58811/_framework/wasm/mono.js:1
_fd_write http://localhost:58811/_framework/wasm/mono.js:1
What is the reasons for this? It seems as if the client side can not access the BlazorExtensions out of the box any more (which worked fine using .NET Core 3.0 and Blazor.Extensions.Storage 1.0).
Same error, but using SignalR extension.
I just hit this error as well 2 days ago. I updated the package now is not working anymore.
In the meantime I downgrade the package to version 0.4.0 until this gets fixed.
Have mine working on 3.1 latest preview both client-side Blazor and server-side Blazor work for me. The error message indicates that the javascript required is either not found at the required path or not loaded. Had to go through these little hoops till this gets fixed: https://github.com/BlazorExtensions/Storage/issues/35#issuecomment-554121492
Yes, the workaround presented by @rovercoder also worked for me: https://github.com/BlazorExtensions/Storage/issues/35#issuecomment-554121492
However, the blazor.extensions.storage.js file (see attachment below) must be always copied to the client's
\bin\Debug\netstandard2.1\dist\_content
folder which is not stored in git by default.
May I ask for a solution and when a new fixed release will be available? Thanks in advance!
Workaround by copying manually this file to \bin\Debug\netstandard2.1\dist_content: blazor.extensions.storage.js.zip <<<
Folks sorry for the delay.
I'm working on a way to make the process of reference the static content (CSS/JS) to the target project the way it expects.
It is important to know that Blazor broke every single component when they removed the ability to add the static content using the resources. Now I'm looking for a way to make this happen properly.
I can't stand off and ask every developer to manually add entries for the static content on their projects as this break the very nature of Nuget and packages. That is the reason I didn't updated all the packages yet as it is pointless.
I'll come out with a proper solution relatively soon. I'll open an issue on the Home repo of this org to let everyone know.
Thanks!
Any news on these topics?
I just installed the Blazor.Extensions.Storage 1.0.0 package on my Client Blazor Project and I am getting the exception: Microsoft.JSInterop.JSException: Could not find 'Storage' in 'window.BlazorExtensions'.
I added the line below in my index.html and I get a 404 resource not found Error.
Is there any way to fix this problem? I also tried installing the latest Preview version of the package and it has the same problem.
Yes, the workaround presented by @rovercoder also worked for me: #35 (comment)
However, the blazor.extensions.storage.js file (see attachment below) must be always copied to the client's
\bin\Debug\netstandard2.1\dist\_content
folder which is not stored in git by default.
May I ask for a solution and when a new fixed release will be available? Thanks in advance!
Workaround by copying manually this file to \bin\Debug\netstandard2.1\dist_content: blazor.extensions.storage.js.zip <<<
@char8cter download this zip a manual reference it.
with .net core 3.1 last solution did not working (((
I also jumped to the Blazor web assembly RC and got this exception. Is there a way to solve it rather than copying files? as a client of tis nuget library, I can't find that file at all...
I have the same issue for v 1.1.0-preview3
_content/Blazor.Extensions.Storage/Storage.js
is not available
I have found that too much time have past without fixing this simple bug. I cloned and improved this code removing all JavaScript dependencies please follow my repo and package BlazorBrowserStorage