question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

XLSX.utils.table_to_book is not a function

See original GitHub issue

I’m using the cdnjs version of XLSX and I found the table_to_book function isn’t even there inside of XLSX.utils.

Am I missing something here?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
SheetJSDevcommented, Jun 10, 2017

@vinhboy It looks like the utils type is not resolving as expected in your context:

export const utils: Utils;
/* ... */
export interface Utils {
/* ... */

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.

1reaction
SheetJSDevcommented, Mar 31, 2017

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

XLSX.utils.book_new() is not a function error - Stack Overflow
I ran into the same issue. It's because the relative path isn't found and therefore cannot call XLSX.utils.book_new.
Read more >
Utility Functions - SheetJS Community Edition
XLSX.utils.aoa_to_sheet takes an array of arrays of JS values and returns a worksheet resembling the input data. Values are interpreted as follows:.
Read more >
SheetJS Tutorial - Convert HTML Table to Excel - Red Stapler
Now let's start with calling table_to_book() utilities function which ... need to export the workbook as xlsx binary using write function.
Read more >
xlsx - npm
var workbook = XLSX.utils.book_new();. The book_new utility function creates an ...
Read more >
How to use the xlsx.utils.json_to_sheet function in xlsx | Snyk
utils.json_to_sheet function in xlsx. To help you get started, we've selected a few xlsx examples, based on popular ways it is used in ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found