excel4node icon indicating copy to clipboard operation
excel4node copied to clipboard

Error: TypeError: Cannot read property 'toUpperCase' of undefined

Open SunboX opened this issue 8 years ago • 4 comments

(node:6600) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: TypeError: Cannot read property 'toUpperCase' of undefined
    at getExcelRowCol (D:\00_Work\00_Hybrid\selfscanclient_print_master_data\node_modules\excel4node\distribution\lib\utils.js:127:20)
    at sortCellRefs (D:\00_Work\00_Hybrid\selfscanclient_print_master_data\node_modules\excel4node\distribution\lib\utils.js:161:16)
    at Array.sort (native)
    at processRows (D:\00_Work\00_Hybrid\selfscanclient_print_master_data\node_modules\excel4node\distribution\lib\worksheet\builder.js:142:34)
    at processNextRows (D:\00_Work\00_Hybrid\selfscanclient_print_master_data\node_modules\excel4node\distribution\lib\worksheet\builder.js:174:13)
    at D:\00_Work\00_Hybrid\selfscanclient_print_master_data\node_modules\excel4node\distribution\lib\worksheet\builder.js:177:9
    at _addSheetData (D:\00_Work\00_Hybrid\selfscanclient_print_master_data\node_modules\excel4node\distribution\lib\worksheet\builder.js:134:12)

SunboX avatar Sep 01 '17 08:09 SunboX

could you provide a gist of a file that causes this error? Following that stack trace, I can't think of a situation that where this error might have occurred.

natergj avatar Nov 17 '17 01:11 natergj

This error happens if you try to write workbook with added 0-based cell like this wb = new Workbook(); ws = wb.addWorksheet('test'); ws.cell(0,0).string('tst'); wb.save('test.xlsx');

Just fixed it in my project. Hope it helps

hastom avatar Nov 18 '17 17:11 hastom

@hastom thanks that was driving me mad :)

mhutfield avatar Oct 14 '19 13:10 mhutfield

Wondering whether there should be a check for this? Additionally that promise rejection should probably be handled?

ajmas avatar Apr 02 '20 23:04 ajmas