-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error while using xslx readFile method #163
Comments
I had the same issue than you. I was able to 'fix' it by manually editing the /lib/xlsx/xform/sheet/row-xform.js file and replacing the line 95 with the following: Unfortunately, the content of the variable spans is used several lines below and since it's empty, it might cause issues that I am not aware of. |
Thanks for the workaround, apparently it is failing at the last element because it is always undefined (apparently). Istead of asigning it to an empty array, I assigned it to the last not-undefined value, which is just [57, 67] var spans = node.attributes.spans ? node.attributes.spans.split(':').map(function(span) { return parseInt(span); }) : [57, 67]; After doing that, another error appeared, which is this one:
Fixed it with yet another workaround (damn it)... if (this.map.color.model) {
this.model.color = this.map.color.model;
} to this if (this.map.color.model && this.model) {
this.model.color = this.map.color.model;
} But still, another error appeared sigh
After some console.logs, I discovered that those lines aren't important, simply commenting them or deleting them will fix that error. This ones (around line 181) // reconcile bookViews
_.each(model.worksheets, function(sheet) {
_.each(sheet.views, function(view) {
var bookView = model.views[view.workbookViewId];
_.extend(view, bookView);
delete view.workbookViewId;
});
}); I don't like workarounds and maybe what I did broke something but for now, it works! Maybe it was just an additional loop somewhere in this code, but this code changes fixed all the issues (for now) and... I'm happy with it. |
Fix issue #163: the "spans" attribute of the row element is optional
Arturas' PR is now published in 0.2.31 - this should fix this issue. |
I believe the issue #186 should also be closed as duplicate. |
In node 6.3.1 I get an additional error:
The error disappears if I use the LTS version (4.4.7)
This is my code:
Is there a way to fix this?
The text was updated successfully, but these errors were encountered: