Solvedalasql alasql.min.js:10 Uncaught Error: Please include the xlsjs library

Something wrong with the library. i try to upload a XLS files ( EXCEL 97 -2003 workbook) through http://alasql.org/demo/008file/.

It shows an error alasql.min.js:10 Uncaught Error: Please include the xlsjs library

i try to import the xlsx or xls files from cdnjs.com but it seems that it is not support.

importing CSV and XLSX are no problem but not XLS.

image

19 Answers

✔️Accepted Answer

@lzzattack I had the same problem.

I solved this:

import alasql from 'alasql';
import XLSX from 'xlsx';

alasql.utils.isBrowserify = false;
alasql.utils.global.XLSX = XLSX;

Other Answers:

Sorry for being late to the party.. All the angular guys, use this:-

import * as alasql from 'alasql';
import * as XLSX from 'xlsx';
alasql['utils'].isBrowserify = false;
alasql['utils'].global.XLSX = XLSX;

No need to include anything in your index.html or angular.cli.json.
Enjoy!