serdarciplak / BlazorMonaco

Blazor component for Microsoft's Monaco Editor which powers Visual Studio Code.
https://serdarciplak.github.io/BlazorMonaco/
MIT License
432 stars 98 forks source link

GetValue not returning when the value is large. #106

Closed Hirad2hhk closed 8 months ago

Hirad2hhk commented 10 months ago

I encountered this problem when i copied a websites source html and i found out that when the editor component is used in blazor server side and the file is larger than 30Kbs(roughly 1000 lines) the method wont return and crashes. This is easily reproduceable by running the sample app in the repository as blazor server-side and pressing the get value button when a large enough text is in the editor.

Hirad2hhk commented 10 months ago

This is a link to the test repository i created for anyone intrested https://github.com/Hirad2hhk/FaultyMonaco

MikeWilliams-UK commented 9 months ago

Just tried this solution and I see same the exact same symptoms when the string pasted into the editor is 260k bytes as I have desribed in #109

MikeWilliams-UK commented 8 months ago

Similar belaviour is seen in Manaco Playground - Issue raised there. https://github.com/microsoft/monaco-editor/issues/4238

da-baranov commented 8 months ago

services.AddSignalR(e => { e.MaximumReceiveMessageSize = 1024 1024 100; });

MikeWilliams-UK commented 8 months ago

Many thanks @da-baranov, My issue is now fixed albeit with a slight tweak required for my app as shown below

var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();

builder.Services.AddSignalR(e => {
    e.MaximumReceiveMessageSize = 1024 * 1024 * 100;
});
MikeWilliams-UK commented 8 months ago

@Hirad2hhk you might want to try the above, it worked for my app

Hirad2hhk commented 8 months ago

Thank you very much @MikeWilliams-UK and @da-baranov . The issue got fixed