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

Created on 11 Oct 2016  路  18Comments  路  Source: agershun/alasql

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

! Bug Code provided to reproduced Help wanted

Most helpful comment

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

All 18 comments

The demo is broken.

I will look into making a jsfiddle example...

Btw: for excel support please use

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.7.12/xlsx.core.min.js"></script>

I did try that, but it doesn't work for xls format.

It will solve

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

image

i tested it before submitting this issue.

XLS support have been added to the example. Please verify its working now...

image

the problem is still existed.

hmmmm

Same issue is occuring to me

@mathiasrw The versions need to be updated in the browser demos. Here's an updated plnkr of the 008file demo: http://plnkr.co/edit/Atqtg7RKrKbXtJ8eH6Qz?p=info

<script src="https://unpkg.com/[email protected]/dist/alasql.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/xlsx.core.min.js"></script>

Awesome! I have updated https://github.com/agershun/alasql-org/blob/gh-pages/demo/008file/index.html so the change should be reflected on http://alasql.org/demo/008file/ any time soon

this is my code:
alasql('SELECT * INTO XLSX("test.xlsx",{headers:true}) FROM ?', [vm.areaData])
but......
2017-10-21 6 20 29

this is my version:
2017-10-21 6 22 44
This is my way of using it
2017-10-23 10 24 55
oh锛侊紒I user vue-cli create project.

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

hi @alexvingg

After using

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

I got error: error TS2339: Property 'utils' does not exist on type 'AlaSQL' in my angular application

could you please elaborate about utils in alasql as I did not manage to find any info about them

hi @fuser84

This error happens because alasql does not find the XLSX dependency. My solution was to import the XLSX dependency and manually inject it into alasql. For it to work it is required isBrowserify = false.

I only tested with vue js.

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!

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

Well done with these configs in Vue. Thanks a lot.

I can confirm this solves the problem in react too

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mathiasrw picture mathiasrw  路  5Comments

SWard1992 picture SWard1992  路  3Comments

DickSwart picture DickSwart  路  6Comments

mathiasrw picture mathiasrw  路  5Comments

SamanthaAdrichem picture SamanthaAdrichem  路  4Comments