Getting error: TypeError: Cannot read property 'replace' of undefined #1368

Closed
opened 2018-11-28 21:35:09 +00:00 by vishenkov · 3 comments
vishenkov commented 2018-11-28 21:35:09 +00:00 (Migrated from github.com)

Hello!
Getting the error while reading this file.
This file is not damaged: opens correctly in Numbers (version 5.3 (5989)). Also correctly parsed by other libraries.

demo repository (file included): https://github.com/vishenkov/xlsx-error-demo
sandbox: https://codesandbox.io/s/github/vishenkov/xlsx-error-demo
file: https://drive.google.com/file/d/1lSR5ZLxQkm0OYLxveYYPVXbpz9t5SExw/view?usp=sharing

/xlsx-error-demo/node_modules/xlsx/xlsx.js:10015
                comment.t = rt.t.replace(/\r\n/g,"\n").replace(/\r/g,"\n");
                                 ^

TypeError: Cannot read property 'replace' of undefined
    at /xlsx-error-demo/node_modules/xlsx/xlsx.js:10015:20
    at Array.forEach (<anonymous>)
    at parse_comments_xml (/xlsx-error-demo/node_modules/xlsx/xlsx.js:10003:65)
    at parse_cmnt (/xlsx-error-demo/node_modules/xlsx/xlsx.js:15094:9)
    at parse_comments (/xlsx-error-demo/node_modules/xlsx/xlsx.js:9945:16)
    at parse_zip (/xlsx-error-demo/node_modules/xlsx/xlsx.js:20021:19)
    at read_zip (/xlsx-error-demo/node_modules/xlsx/xlsx.js:20249:9)
    at readSync (/xlsx-error-demo/node_modules/xlsx/xlsx.js:20314:69)
    at Object.readFileSync (/xlsx-error-demo/node_modules/xlsx/xlsx.js:20328:9)
    at Object.<anonymous> (/xlsx-error-demo/index.js:3:23)
Hello! Getting the error while reading this file. This file is not damaged: opens correctly in Numbers (version 5.3 (5989)). Also correctly parsed by other libraries. **demo repository (file included)**: https://github.com/vishenkov/xlsx-error-demo **sandbox**: https://codesandbox.io/s/github/vishenkov/xlsx-error-demo **file**: https://drive.google.com/file/d/1lSR5ZLxQkm0OYLxveYYPVXbpz9t5SExw/view?usp=sharing ``` /xlsx-error-demo/node_modules/xlsx/xlsx.js:10015 comment.t = rt.t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"); ^ TypeError: Cannot read property 'replace' of undefined at /xlsx-error-demo/node_modules/xlsx/xlsx.js:10015:20 at Array.forEach (<anonymous>) at parse_comments_xml (/xlsx-error-demo/node_modules/xlsx/xlsx.js:10003:65) at parse_cmnt (/xlsx-error-demo/node_modules/xlsx/xlsx.js:15094:9) at parse_comments (/xlsx-error-demo/node_modules/xlsx/xlsx.js:9945:16) at parse_zip (/xlsx-error-demo/node_modules/xlsx/xlsx.js:20021:19) at read_zip (/xlsx-error-demo/node_modules/xlsx/xlsx.js:20249:9) at readSync (/xlsx-error-demo/node_modules/xlsx/xlsx.js:20314:69) at Object.readFileSync (/xlsx-error-demo/node_modules/xlsx/xlsx.js:20328:9) at Object.<anonymous> (/xlsx-error-demo/index.js:3:23) ```
raulgomezn commented 2018-12-17 22:27:04 +00:00 (Migrated from github.com)

We need to validate if rt.r is not undefined

We need to validate if rt.r is not undefined
SheetJSDev commented 2021-09-15 07:10:38 +00:00 (Migrated from github.com)

The underlying issue has been resolved in version 0.15.0

The underlying issue has been resolved in version 0.15.0
raulgomezn commented 2021-09-15 11:58:03 +00:00 (Migrated from github.com)

Thanks

Thanks
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#1368
No description provided.