-
Notifications
You must be signed in to change notification settings - Fork 48
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
Upgrading Blazor WebAssembly to 3.1.0-preview4.19579.2 leads to an error: Could not find 'BlazorExtensions' in 'window'. #66
Comments
…aded after update to 3.1.0-preview4.19579.2 (lead to error: Could not find 'BlazorExtensions' in 'window'. Error: Could not find 'BlazorExtensions' in 'window'). See BlazorExtensions#66 for more details.
In szmalec@0d8fe51 you can see modified
It looks that previously existed entry Am I wrong at any of above points? So if anyone wants to have 3.1.0-preview4.19579.2 and Blazor.Extensions.SignalR then can use my temporary solution. |
…aded after update to 3.1.0-preview4.19579.2 (lead to error: Could not find 'BlazorExtensions' in 'window'. Error: Could not find 'BlazorExtensions' in 'window'). See BlazorExtensions#66 for more details.
I cannot find the This issue is blocking my team from doing any work right now. Do we have any fixes? I tried following what you guys are talking about up above but I cannot reproduce your fix. |
Ran into the same issue, even managed to replace the BlazorExtensions.Storage with another solution before finding out what the root issue was. I'd very much also appreciate a bit more elaborate (or dumbed down, if you will) set of workaround steps if anyone is able and willing. I haven't been able to locate another solution for doing SignalR in Blazor WASM. |
It's just a temporary fix until the proper patch is merged in but you can compile the js manually and reference that from your index.html |
I was able to get around this issue by creating a new Razor Class Library, and adding: https://github.com/BlazorExtensions/SignalR/files/4007658/blazor.extensions.signalr.txt (renamed to .js) to RazorClasssLibrary\wwwroot\Blazor.Extensions.SingalR.js and adding the following:
Once I did this, it appears the websocket was at least connecting. (Although I don't have more information on if there is a better place to put this reference.) |
Actually with all the changes made in @szmalec's branch everything works, even in WebAssembly. Is this project still maintained? Can we open a PR? Are we waiting for blazor-wasm-3.2-preview1 to be released? |
It looks like a SignalR client is scheduled for 3.2-preview3: |
It looks that we can now forget about problems with Blazor Extensions SignalR and use Microsoft.AspNetCore.SignalR.Client directly - see "Support for the .NET SignalR client" section @ https://devblogs.microsoft.com/aspnet/blazor-webassembly-3-2-0-preview-1-release-now-available/ |
@szmalec Yes, the SignalR client is now supported on WebAssembly as expected. One quick note... Before you blame "Blazor Extensions SignalR problems", please read the real reason why it has problems before start attacking others. For future readers, the problem is caused because Blazor changed the way it deals with static content (CSS/JS) and that breaks every single extension out there making components useless. As stated here we are working on bring a solution for this issue that doesn't requires manual interaction with JS/CSS files by the final user otherwise, it will not make any sense at all. It beats the purpose of a NuGet package in its essence. |
@galvesribeiro I know that SignalR Blazor Extensions is a piece of awesome work - thank you for your commitment and willingness to share the results of your hard work with the community!! Now I also know that the recommendation of switching to the official Microsoft.AspNetCore.SignalR.Client in the WASM Blazor apps was not necessarily a good move (at least for now when blazor wasm is not officialy production ready), because after migration I encountered other problems (related to JWT auth) So again - we should remember that Blazor WASM is still an alpha phase;) |
Recently I tried to update my blazor wasm project (which uses
Blazor.Extensions.SignalR v1.1.0-preview3
) to latest3.1.0-preview4.19579.2
Blazor version.After updating, an error began to appear in browser console:
It is probably due to latest changes related to static assets in libraries - as we can see at https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-core-3-1/
There is also PR @ AspNetCore src repo: https://github.com/aspnet/AspNetCore/pull/17353/files
Problem is also reported in several other projects which uses *.js static assets.
Initially I have also tried to update
Blazor.Extensions.SignalR
to3.1.0-preview4.19579.2
and the sameCould not find 'BlazorExtensions' in 'window'
occured whenBlazor.Extensions.SignalR.Test.Server
started.I have discovered some differences between old build output and new build output, eg.:
[old - netstandard2.0]
test\Blazor.Extensions.SignalR.Test.Client\bin\Debug\netstandard2.0\dist\_content\Blazor.Extensions.SignalR.JS
"jsReferences": [ "_content/Blazor.Extensions.SignalR.JS" ]
entry intest\Blazor.Extensions.SignalR.Test.Client\bin\Debug\netstandard2.0\dist\_framework\blazor.boot.json
[new - netstandard2.1]
test\Blazor.Extensions.SignalR.Test.Client\bin\Debug\netstandard2.1\dist\_content\Blazor.Extensions.SignalR.JS
does NOT existstest\Blazor.Extensions.SignalR.Test.Client\bin\Debug\netstandard2.1\dist\_framework\blazor.boot.js
on does NOT contain"jsReferences": [ "_content/Blazor.Extensions.SignalR.JS" ]
entryI have forked
Blazor.Extensions.SignalR
repo and I will try to prepare workaround...The text was updated successfully, but these errors were encountered: