excel-as-json icon indicating copy to clipboard operation
excel-as-json copied to clipboard

ConvertExcel function doesn't trigger call back

Open piyushgupta1 opened this issue 6 years ago • 4 comments

I am using this lib in a simple way where i get a excel and i have to covert the excel to json.

It works perfectly most of the time but sometimes the callback func is never called. Even though data is same and files its trying to read exist.

I am uploading the test file we are using also a small code sample Test (2).xlsx

exports.excelToJson = (path, options) => {

  return new Promise((resolve, reject) => {

    ConvertExcel(path, null, options, (err, data) => {

      if (err){

        return reject(err);
      }
      return resolve(data);
    });
  });
};

path = "uploads/Test (1).xlsx_1531299759197"
options = {sheet: "1", isColOriented: false, omitEmtpyFields: false}

I will be available if any other details are required.

piyushgupta1 avatar Jul 11 '18 09:07 piyushgupta1

Thanks for the bug report and including a test excel doc as well as code to reproduce. Can you provide:

OS & version: Node.js version: Any other info that makes your environment unique:

stevetarver avatar Aug 23 '18 22:08 stevetarver

Apologies for delay response. We solved the issue by replacing the lib with different one. But would like to have it resolved.

OS & version: Ubuntu 16.04 LTS Node.js version: 8.11.2

Using HapiJs for api's and the callback is bound to an upload API call. We have established that the file is created by the code above this parsing code.

piyushgupta1 avatar Jan 10 '19 09:01 piyushgupta1

@piyushgupta1 Wondering which lib did you replace with?

From the library design aspect, I am not sure if it make sense to always have the ConvertExcel to return a promise so user can have better handler.

jackyq2015 avatar Mar 17 '19 03:03 jackyq2015

@jackyq2015 We replaced it with SheetJs. It can almost do all things excel.

piyushgupta1 avatar Mar 17 '19 03:03 piyushgupta1