tomvlk / node-split-file

:seedling: NodeJS Module to split and merge files for several purposes like transporting over unstable networks.
MIT License
41 stars 13 forks source link

splitFile throws an error: expecting a function but got [object Undefined] #37

Closed sanuann closed 3 years ago

sanuann commented 3 years ago

I've followed the example here and done this: in HTML I have: <input type='file' id='input' @change="testUpload">

const file = document.getElementById('input').files[0];

splitFile.splitFile(file, 3)
  .then((names) => {
    console.log(names);
  })
  .catch((err) => {
    console.log('Error: ', err);
  });

and i get this error:

vue.runtime.esm.js?2b0e:1888 TypeError: expecting a function but got [object Undefined]
    at Function.Promise.promisify (bluebird.js?f684:4098)
    at SplitFile.splitFile (split-file.js?c48c:33)
    at VueComponent.testUpload (SaveData.vue?ad64:103)
    at invokeWithErrorHandling (vue.runtime.esm.js?2b0e:1854)
    at HTMLInputElement.invoker (vue.runtime.esm.js?2b0e:2179)
    at HTMLInputElement.original._wrapper (vue.runtime.esm.js?2b0e:6917)

what does this error mean?

tomvlk commented 3 years ago

I'm pretty sure it's something related to your implementation.