While sending a large file data, streamed as a string from my backend to frontend, the blazor app crashes with the attempting to reconnect to server error. The app crashes when the file is loaded as a string successfully and right before sent to the ui.
I suspect the signalR is being disconnected. Any idea how do I fix this?
I Expected it to send the data to the UI successfully. I could not see any error from my logs during the app crash as well
My LoadFile() method is shown below:
private async Task LoadFile(string file) { isFileLoading = true; // Start spinner selectedFile = file; InvokeAsync(StateHasChanged); // Ensure UI updates again await Task.Yield(); try { //await Task.Delay(2000); if (OnFileSelected.HasDelegate) { await OnFileSelected.InvokeAsync(file); // Invoke parent's method } } finally { isFileLoading = false; // Stop spinner selectedFile = string.Empty; InvokeAsync(StateHasChanged); // Ensure UI updates again await Task.Yield(); // Reset after loading completes } }