Skip to content

Provide guidance about moving large amount of data from JavaScript into Blazor. #10083

@rxelizondo

Description

@rxelizondo

Describe the bug

When attempting to move "large" amounts of data from JavaScript into Blazor I get different errors at different times:

wasm-0074c056:474 Uncaught (in promise) RangeError: Maximum call stack size exceeded

blazor.webassembly.js:1 Uncaught (in promise) Error: System.Reflection.TargetException: Non-static method requires a target.

blazor.webassembly.js:1 Uncaught (in promise) Error: System.BadImageFormatException: Method has zero rva

To Reproduce

Using version of ASP.NET Core 3.0.0-preview4-19216-03

JavaScript side:

function GetLongString() {
    return "a".repeat(6000000);
}

Blazor Side:

((IJSInProcessRuntime)JSRuntime).Invoke<string>("GetLongString", null);

Making the call from Blazor into JavaScript generates the errors in the browser console. Note that what I am really trying to do is to move pictures from JavaScript into Blazor by first serializign the pictures into base64 and them moving them to Blazor as suggested here: https://github.com/aspnet/Blazor/issues/527#issuecomment-401840036

Thanks.

Metadata

Metadata

Assignees

Labels

DocsThis issue tracks updating documentationDoneThis issue has been fixedarea-blazorIncludes: Blazor, Razor Componentsfeature-blazor-wasmThis issue is related to and / or impacts Blazor WebAssembly

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions