-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Blazor Preview4 increase buffer size #9570
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
Comments
Try this: services.AddServerSideBlazor().AddSignalR().AddHubOptions<ComponentHub>(o =>
{
o.MaximumReceiveMessageSize = 102400000;
}); |
That doesn't seem to resolve the issue. I can confirm its not my code because I made an image under the buffer size and it uploads fine. My javascript code
My C# Code
|
Are you sure you're hitting a size limit then? How big is the image? |
@davidfowl Not very big. Tested with 5kb - 13kb. Before was able to upload 6mb plus images. Looking further into things seems like it could also be that the dataurl string is too long. Simplified test repo is located here https://dev.azure.com/twinnaz/_git/BlazorBug |
I've got the same problem. I've investigated that it's not because MaximumReceiveMessageSize. It is impossible to invoke .NET method from javascript if parameters passed to method are to big. I guess, the limit of parameters serialized to JSON during invokeMethodAsync is 4KB. Worked fine before preview 4. |
Dedicated server-side project with simple tester on first page to reproduce: |
This can be done today in the same way with endpoint routing. endpoints.MapHub<ComponentHub>(
ComponentHub.DefaultPath,
o =>
{
o.ApplicationMaxBufferSize = 102400000; // larger size
o.TransportMaxBufferSize = 102400000; // larger size
})
// .AddComponent<App>("app"); For the record, in the future we plan to hide the specific hub we use and expose all the SignalR configuration options on MapBlazorHub. |
@javiercn Can you please explain exactly how this can be done today? Adding the snippet above does not work, but I may well be doing something incorrectly. |
@javiercn Adding the above code gives error in console.
Adding on the BlazorHub doesn't compile.
|
@javiercn @mkArtakMSFT If possible can you provide a working repo to test. |
@javiercn that no longer will prevent the size limit from being hit but it's not being hit in this issue. |
@javiercn: I pushed your workaround to a new branch |
Moving this to |
I submitted a PR to add overloads that allow configuring this (somehow they got lost). I expect the issues in json serialization issue to go away with @pranavkm changes |
I think we exposed the wrong options here. There are a new set of options in 3.0 to increase the message size |
@davidfowl :( what should it be then? This is what we were doing before. |
It's on HubOptions which I believe is already exposed: |
That’s fine, but I imagine that is global and this is local to the endpoint. Isn’t it? Independent of that setting I would expect it will still be valuable to configure this and other things on the endpoint. We should not hide the underlying hub endpoint configuration. |
No, the configuration that was the max buffer size before is just an optimization now.
Sure it's not "bad" to expose this setting, it just doesn't do what you think it does and I'd imagine is going to be much less useful to set in the future. |
[EDIT] : I find the solution for preview 7 in another post, i put the solution bellow
Hi guys, i'm currently under preview 7 (server-side version) and i meet the same problem.
I'm unable to resolve ComponentHub. When i check what's expected, it's seem to be a IComponent (so my root Component ?) I don't understand what can i done now to bypass the problem thanks for your help ! |
Using the new Blazor Serverside Preview 4 breaks my upload Component.
Preview 3 I was able to increase the SignalR connection buffer size using
In preview 4 it has switched to endpoint routing
How would I configure MapBlazorHub();
Related Issue #7884
The text was updated successfully, but these errors were encountered: