excel4node
excel4node copied to clipboard
Error: TypeError: Cannot read property 'toUpperCase' of undefined
(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)
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.
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 thanks that was driving me mad :)
Wondering whether there should be a check for this? Additionally that promise rejection should probably be handled?