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

I was displaying a bunch large text files inside blazor, this's what's happened #51597

Closed
1 task done
Xyncgas opened this issue Oct 24, 2023 · 7 comments
Closed
1 task done
Labels
area-blazor Includes: Blazor, Razor Components

Comments

@Xyncgas
Copy link

Xyncgas commented Oct 24, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I was reading a bunch large text files inside browser, this's what's happened

image

Files are ranging from 5KB to 300KB, got 50 of those for starter wanted to see if I can show these string
I created elements simply by using @FileString inside div
I am using Visual Studio Version 17.8.0 Preview 4.0

Expected Behavior

I can display a website today with 10MB plaintext in browser, there is no reason I can't do it in blazor, it should do what's capable in the browser

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Oct 24, 2023
@Xyncgas
Copy link
Author

Xyncgas commented Oct 24, 2023

For me Visual Studio debugger didn't say anything
Meanwhile if I use javascript interop to set innerText directly it works

@Xyncgas
Copy link
Author

Xyncgas commented Oct 24, 2023

dotnet/corefx#40796

@Xyncgas
Copy link
Author

Xyncgas commented Oct 24, 2023

Well, I am guessing there is reason for a size limit, blazor is for displaying the web though, so if you are visiting anything on the web that has a lot of text I guess it's not going to show anything, it shouldn't be designed that way for blazor (removing the limit would be better because it's my domain to concern)

@javiercn
Copy link
Member

@Xyncgas thanks for contacting us.

From what I can tell the limit is 125MB, which means that:

  1. It's very hard to hit on regular use cases.
  2. It's not clear you would get good peformance out of it.

In the end, this has to do with the serialization mechanism used by webview, and unfortunately, this is not something we have much control over, since the options to communicate between webview and host are pretty limited.

@gragra33
Copy link

@Xyncgas Are you trying to work with large JSON files? If yes, I have a solution.

@mkArtakMSFT
Copy link
Member

Looks like this is due to a limitation in the serialization stack. There is an existing issue asking for increasing that limit: dotnet/runtime#61089

@mkArtakMSFT mkArtakMSFT closed this as not planned Won't fix, can't repro, duplicate, stale Oct 25, 2023
@gragra33
Copy link

Here is my solution to overcome this issue: BlazorJsonStreamingSample

@ghost ghost locked as resolved and limited conversation to collaborators Nov 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

No branches or pull requests

4 participants