BlazorInputFile icon indicating copy to clipboard operation
BlazorInputFile copied to clipboard

Multiple files fails with this error (Single file is ok)

Open adrianchavero opened this issue 4 years ago • 2 comments

Microsoft.JSInterop.JSException HResult=0x80131500 Mensaje = Cannot read property '_blazorFilesById' of null TypeError: Cannot read property '_blazorFilesById' of null at getFileById (https://localhost:5001/_content/BlazorInputFile/inputfile.js:114:25) at getArrayBufferFromFileAsync (https://localhost:5001/_content/BlazorInputFile/inputfile.js:123:20) at Object.readFileData (https://localhost:5001/_content/BlazorInputFile/inputfile.js:76:31) at https://localhost:5001/_framework/blazor.server.js:8:31421 at new Promise () at e.beginInvokeJSFromDotNet (https://localhost:5001/_framework/blazor.server.js:8:31390) at https://localhost:5001/_framework/blazor.server.js:1:19202 at Array.forEach () at e.invokeClientMethod (https://localhost:5001/_framework/blazor.server.js:1:19173) at e.processIncomingData (https://localhost:5001/_framework/blazor.server.js:1:17165) Origen = System.Private.CoreLib Seguimiento de la pila: at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at BlazorInputFile.RemoteFileListEntryStream.<CopyFileDataIntoBuffer>d__6.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at BlazorInputFile.FileListEntryStream.<ReadAsync>d__21.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Analytics.Helpers.FileUtils.<UploadFiles>d__1.MoveNext() in

adrianchavero avatar Jun 02 '20 17:06 adrianchavero

I am facing with the same issue. Also without multiple attribute.

      Unhandled exception rendering component: Cannot read property '_blazorFilesById' of null
      TypeError: Cannot read property '_blazorFilesById' of null
          at getFileById (https://localhost:5001/frontend/js/inputfile.js:115:25)
          at getArrayBufferFromFileAsync (https://localhost:5001/frontend/js/inputfile.js:124:20)
          at Object.readFileData (https://localhost:5001/frontend/js/inputfile.js:77:31)
          at https://localhost:5001/frontend/_framework/blazor.webassembly.js:1:9873
          at new Promise (<anonymous>)
          at Object.beginInvokeJSFromDotNet (https://localhost:5001/frontend/_framework/blazor.webassembly.js:1:9841)
          at _mono_wasm_invoke_js_marshalled (https://localhost:5001/frontend/_framework/wasm/dotnet.3.2.0.js:1:171294)
          at do_icall (<anonymous>:wasm-function[6049]:0x10f8b1)
          at do_icall_wrapper (<anonymous>:wasm-function[1896]:0x50b6a)
          at interp_exec_method (<anonymous>:wasm-function[1120]:0x2588e)
Microsoft.JSInterop.JSException: Cannot read property '_blazorFilesById' of null
TypeError: Cannot read property '_blazorFilesById' of null
    at getFileById (https://localhost:5001/frontend/js/inputfile.js:115:25)
    at getArrayBufferFromFileAsync (https://localhost:5001/frontend/js/inputfile.js:124:20)
    at Object.readFileData (https://localhost:5001/frontend/js/inputfile.js:77:31)
    at https://localhost:5001/frontend/_framework/blazor.webassembly.js:1:9873
    at new Promise (<anonymous>)
    at Object.beginInvokeJSFromDotNet (https://localhost:5001/frontend/_framework/blazor.webassembly.js:1:9841)
    at _mono_wasm_invoke_js_marshalled (https://localhost:5001/frontend/_framework/wasm/dotnet.3.2.0.js:1:171294)
    at do_icall (<anonymous>:wasm-function[6049]:0x10f8b1)
    at do_icall_wrapper (<anonymous>:wasm-function[1896]:0x50b6a)
    at interp_exec_method (<anonymous>:wasm-function[1120]:0x2588e)
  at BlazorInputFile.RemoteFileListEntryStream.CopyFileDataIntoBuffer (System.Int64 sourceOffset, System.Byte[] destination, System.Int32 destinationOffset, System.Int32 maxBytes, System.Threading.CancellationToken cancellationToken) <0x3a64038 + 0x0019e> in <filename unknown>:0 
  at BlazorInputFile.FileListEntryStream.ReadAsync (System.Byte[] buffer, System.Int32 offset, System.Int32 count, System.Threading.CancellationToken cancellationToken) <0x3a61388 + 0x00126> in <filename unknown>:0 
  at System.Threading.Tasks.ValueTask`1[TResult].get_Result () <0x3a7e968 + 0x00034> in <filename unknown>:0 
  at System.IO.Stream.CopyToAsyncInternal (System.IO.Stream destination, System.Int32 bufferSize, System.Threading.CancellationToken cancellationToken) <0x3a5d198 + 0x00134> in <filename unknown>:0 ```

8VAid8 avatar Aug 25 '20 11:08 8VAid8

Did you modify your page, so the InputFile element is not rendered anymore? It has to stay present, otherwise the browser cleans up any resources associated with it.

BtbN avatar Sep 15 '20 14:09 BtbN