BlazorInputFile
BlazorInputFile copied to clipboard
Multiple files fails with this error (Single file is ok)
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 (1.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.TaskAwaiter
1.GetResult()
at Analytics.Helpers.FileUtils.<UploadFiles>d__1.MoveNext() in
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 ```
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.