Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

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

Open
adrianchavero opened this issue Jun 2, 2020 · 2 comments
Open

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

adrianchavero opened this issue Jun 2, 2020 · 2 comments

Comments

@adrianchavero
Copy link

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.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.d__1.MoveNext() in

@8VAid8
Copy link

8VAid8 commented Aug 25, 2020

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 ```

@BtbN
Copy link

BtbN commented Sep 15, 2020

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants