XLSX.utils.table_to_book is not a function #618
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#618
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'm using the cdnjs version of XLSX and I found the
table_to_book
function isn't even there inside ofXLSX.utils
.Am I missing something here?
table_to_book
was added after the 0.9.7 release. We are in the middle of testing for 0.9.8 and expect to release within the hour@SheetJSDev Perfect, thanks! 👍
@Vercryger we pushed 0.9.8 and it's live on NPM and http://oss.sheetjs.com/js-xlsx/ and on unpkg: https://unpkg.com/xlsx@0.9.8/dist/xlsx.core.min.js
I don't know how long it will take for cdnjs to update (and it's not in our control) but hopefully it's in the next few hours. Until then use unpkg.
I am using Angular 4 (TypeScript) and xlsx@^0.10.4. Everything seems to be working, except
XLSX.utils
only has the following properties@vinhboy It looks like the utils type is not resolving as expected in your context:
TSLint is perfectly happy with this but I'm guessing angular is doing something unexpected. We will rename the type to
XLSX$Utils
to avoid this issue.@SheetJSDev thanks for the quick turnaround, however, that was not the problem. I dug around all your examples a bit and finally found something that worked for me
https://gist.github.com/vinhboy/78c7b2a8efd866ea36d2109bd33e93af
Two important things
XLSX
using systemjs meta configLet me know if any of this make sense to you, because I still don't fully understand it.
It just seems like there are a lot of manual configurations here that could be autodetected.
Thanks
@vinhboy there are 3 deployment scenarios:
in the browser, using a direct script tag (e.g.
<script src="xlsx.full.min.js"></script>
)in node, using
require('xlsx')
with some hybrid module bundler/loader
The script is designed to work in the first two cases, and there are plenty of dynamic checks to ensure that node-specific code is only run when require is available. For example, the
fs
module is only required in node:Now, module builders aren't clever enough to see the typeof guard and realize that the module can only be required in node, hence the need for the configuration.
I would hope that the
browser
field inpackage.json
would suffice: https://github.com/SheetJS/js-xlsx/blob/master/package.json#L12but systemjs doesn't seem to read it.