excel.js icon indicating copy to clipboard operation
excel.js copied to clipboard

Some errors thrown as exceptions rather than being passed to parseXlsx's callback

Open addrummond opened this issue 11 years ago • 6 comments

Unfortunately I'm not familiar enough with the promise library to be able to see how to fix this yet, but it seems that some errors get thrown as exceptions rather than being passed to the callback given to parseXlsx. For example, if you give parseXslx the path of a nonexistent file, an ENOENT exception is thrown. The intended behavior is (presumably?) for such errors to be passed on to the callback.

var parseXlsx = require('excel');

parseXlsx('nonexistent-file', function () {
    console.log(arguments);
});

======> Throws exception

addrummond avatar May 30 '13 20:05 addrummond

I was trying this

My app.js

var express = require('express'); //Call Express module var app = express(); //Create server var parseXlsx = require('excel');

    parseXlsx('Sheet.xlsx', function(err, data) {
        console.log('sdf');
        if(err) throw err;
        // data is an array of arrays
        console.log(data);
    });

app.listen(3003);

But I'm getting error

/home/local/user/Desktop/sample/node_modules/excel/node_modules/node-promise/promise.js:199

      throw error;
            ^

Error: invalid signature: 0x4acf92ad (at position: 0x29) at /home/local/user/Desktop/sample/node_modules/excel/node_modules/unzip/lib/parse.js:56:13 at /home/local/user/Desktop/sample/node_modules/excel/node_modules/unzip/node_modules/pullstream/pullstream.js:101:11 at process._tickCallback (node.js:415:13)

How to fix this issue? My file is existing i crosschecked it. My xlsx file is in the same folder as app.js

SreekeshOkky avatar Jun 06 '13 05:06 SreekeshOkky

It's the issue with the old 'unzip' library version used - it doesn't support zip format used by LibreOffice and Google Docs for producing XLSX

amakhrov avatar Jul 20 '13 17:07 amakhrov

I'm running into this error as well. Would it be possible to get around this by using a different unzip library?

kbanman avatar Nov 19 '13 00:11 kbanman

I believe a new unzip lib is used already - could you confirm you use the most recent versions of excel module? If yes, could you post the error output here?

amakhrov avatar Nov 19 '13 05:11 amakhrov

+1 invalid signature: 0x20726176

/node_modules/excel/node_modules/node-promise/promise.js:204 throw error;

/node_modules/excel/node_modules/unzip/lib/parse.js:63:13 at process._tickCallback (node.js:415:13)

seti123 avatar Mar 10 '14 12:03 seti123

Downloading Bootloader ... **** OpenOCD failed - ensure you have installed the driver from the drivers directory, and that the debugger is not running **** In Linux this may be due to USB access permissions. In a virtual machine it may be due to USB passthrough settings. Check in the task list that another OpenOCD process is not running. Check that you have the correct target and JTAG device plugged in. **** Downloading DCT ... **** OpenOCD failed - ensure you have installed the driver from the drivers directory, and that the debugger is not running **** In Linux this may be due to USB access permissions. In a virtual machine it may be due to USB passthrough settings. Check in the task list that another OpenOCD process is not running. Check that you have the correct target and JTAG device plugged in. **** Downloading Application ... **** OpenOCD failed - ensure you have installed the driver from the drivers directory, and that the debugger is not running **** In Linux this may be due to USB access permissions. In a virtual machine it may be due to USB passthrough settings. Check in the task list that another OpenOCD process is not running. Check that you have the correct target and JTAG device plugged in. **** Build complete

I am able to build and install on the same development board using 3.1.2 I've sent a bug ticket to BCM.

kgillespieatmosphere avatar Jun 08 '15 15:06 kgillespieatmosphere