TelerikGrid Reorderable

2023. 6. 13. 10:12Front-End/Blazor

회사에서 위와 같이 TelerikGrid를 사용해서 이미지 업로드 하는 UI이가 있습니다.

이미지는 순서와 상관없이 비동기로 업로드가 되며, 업로드가 될 때 ProgressBar가 자동으로 100%까지 채워집니다.

에러

로컬에서 테스트를 할 때는 정상적으로 잘 동작을 했는데, 성능이 낮은 서버에서 실행하니 자꾸 에러가 났습니다.

Uncaught (in promise) Error: System.ArgumentException: There is no tracked object with id '14'. Perhaps the DotNetObjectReference instance was already disposed. (Parameter 'dotNetObjectId')
   at Microsoft.JSInterop.JSRuntime.GetObjectReference(:8080/Images/Int64 dotNetObjectId)
   at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.BeginInvokeDotNet(:8080/Images/JSRuntime jsRuntime, DotNetInvocationInfo invocationInfo, String argsJson)
    at Ft.endInvokeDotNetFromJS (blazor.server.js:1:3718)
    at Ft._invokeClientMethod (blazor.server.js:1:75066)
    at Ft._processIncomingData (blazor.server.js:1:72690)
    at Ft.connection.onreceive (blazor.server.js:1:67003
[2023-06-11T23:17:08.594Z] Error: Microsoft.JSInterop.JSException: There is no file with ID 1. The file list may have changed. See https://aka.ms/aspnet/blazor-input-file-multiple-selections.
Error: There is no file with ID 1. The file list may have changed. See https://aka.ms/aspnet/blazor-input-file-multiple-selections.
    at je (http://192.168.100.100:8080/_framework/blazor.server.js:1:33191)
    at Object.readFileData (http://1192.168.100.100:8080/_framework/blazor.server.js:1:33117)
    at http://192.168.100.100:8080/_framework/blazor.server.js:1:3506
    at new Promise (<anonymous>)
    at Ft.beginInvokeJSFromDotNet (http://192.168.100.100:8080/_framework/blazor.server.js:1:3480)
    at Ft._invokeClientMethod (http://192.168.100.100:8080/_framework/blazor.server.js:1:75066)
    at Ft._processIncomingData (http://192.168.100.100:8080/_framework/blazor.server.js:1:72690)
    at Ft.connection.onreceive (http://192.168.100.100:8080/_framework/blazor.server.js:1:67003)
    at i.onmessage (http://192.168.100.100:8080/_framework/blazor.server.js:1:51316)
   at Microsoft.AspNetCore.Components.Forms.BrowserFileStream.OpenReadStreamAsync(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Components.Forms.BrowserFileStream.CopyFileDataIntoBuffer(Memory`1 destination, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Components.Forms.BrowserFileStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)
   at Services.ClientServices.ImageFileUploadClientService.<>c__DisplayClass6_0.<<UploadAsync>b__0>d.MoveNext() in /src/Services/ClientServices/ImageFileUploadClientService.cs:line 80
--- End of stack trace from previous location ---

해결책

문제는 TelerikGrid에 Reorderable=true 옵션으로 생긴 문제입니다.

Reorderable은 열의 순서를 변경할수 있는 옵션입니다. 이 옵션과 재랜더링이 되면서 ID를 찾지 못하는 문제에 대해 관계를 잘 이해가 되지 않지만, 일단을 해결이 되었습니다.

 

'Front-End > Blazor' 카테고리의 다른 글

SDK 7.0.302 사태 정리  (0) 2023.06.09