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

Net 8.0 iOS System.Text.Json.Serialization.JsonConverter System.ArgumentOutOfRangeException [Bug] #228

Open
Meoqan opened this issue Nov 22, 2023 · 1 comment
Labels
Bug Something isn't working Triage Issue needs to be triaged

Comments

@Meoqan
Copy link

Meoqan commented Nov 22, 2023

Describe the bug
while testing my app under Net 8.0 on iOS, LocalStorage seems to break the serializer for some reason.
If i delete the data in the browser storage, the app loads the data from the api then everything works fine.

LocalStorage works with Windows and MacOSX browsers on Net 8.0.
No Issue with LocalStorage on Net 7.0 with iOS.

To Reproduce
Steps to reproduce the behavior:
Migrate a app with LocalStorage to Net 8.0 and test it on iOS
Save or load Json/object data to LocalStorage with a Base64 Image (the image breaks)
Try to load Json data from a WebAPI with >174kb size (not LocalStorage, small data works fine)

the following error message appears:
System.ArgumentOutOfRangeException: Arg_ArgumentOutOfRangeException at System.Text.Json.Serialization.JsonConverter1 [[BlazorApp.JsonClass.Article[], BlazorApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].ReadCore(Utf8JsonReader& , JsonSerializerOptions , ReadStack& ) at System.Text.Json.Serialization.Metadata.JsonTypeInfo1.<DeserializeAsync>d__1 [[BlazorApp.JsonClass.Article[], BlazorApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext() at System.Text.Json.Serialization.JsonConverter1 [[BlazorApp.JsonClass.Article[], BlazorApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].ReadCore(Utf8JsonReader& , JsonSerializerOptions , ReadStack& ) at System.Net.Http.Json.HttpClientJsonExtensions.<<FromJsonAsyncCore>g__Core|12_0>d2 [[BlazorApp.JsonClass.Article[], BlazorApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Text.Json.JsonSerializerOptions, System.Text.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]].MoveNext() at System.Text.Json.Serialization.JsonConverter1 [[BlazorApp.JsonClass.Article[], BlazorApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].ReadCore(Utf8JsonReader& , JsonSerializerOptions , ReadStack& ) at BlazorApp.JsonClass.Article.GetList(HttpClient Http, String OrganizationName, String ContextName) at System.Text.Json.Serialization.JsonConverter1 [[BlazorApp.JsonClass.Article[], BlazorApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].ReadCore(Utf8JsonReader& , JsonSerializerOptions , ReadStack& ) at BlazorApp.Module.Context.IndexComponent.OnParametersSetAsync()

Hosting Model:

  • Blazor WebAssembly

Additional context
I use the WriteIndented option
builder.Services.AddBlazoredLocalStorage(config => config.JsonSerializerOptions.WriteIndented = false);

@Meoqan Meoqan added Bug Something isn't working Triage Issue needs to be triaged labels Nov 22, 2023
@jacksonsfaria
Copy link

Net 8 error for me.

"ConstructorContainsNullParameterNames, System.Collections.Generic.KeyValuePair2[System.String,System.Collections.Generic.IEnumerable1[System.String]]"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants