0

So reading another article and solution here I found the library Alasql which seems to do what I need.

I've installed it and was writing a proof-of-concept application to use it and when I attempt to use the illustration given in that article I get:

Error: jszip is not a constructor
write_zip@https://server:8443/vendor/js-xlsx/dist/xlsx.js:11295:12
write_zip_type@https://server:8443/vendor/js-xlsx/dist/xlsx.js:11407:10
writeSync@https://server/vendor/js-xlsx/dist/xlsx.js:11421:1
saveWorkbook@https://server:8443/vendor/alasql/dist/alasql.js:15656:17
doExport@https://server/vendor/alasql/dist/alasql.js:15556:3
alasql.into.XLSX@https://server/vendor/alasql/dist/alasql.js:15529:3
anonymous@https://server/vendor/alasql/dist/alasql.js line 7343 > Function:1:14
queryfn3@https://server/vendor/alasql/dist/alasql.js:6528:13
queryfn2@https://server/vendor/alasql/dist/alasql.js:6274:9
anonymous@https://server/vendor/alasql/dist/alasql.js line 7757 > Function:1:57
queryfn/<@https://server/vendor/alasql/dist/alasql.js:6223:12
queryfn@https://server/vendor/alasql/dist/alasql.js:6219:2
yy.Select.prototype.compile/statement@https://server/vendor/alasql/dist/alasql.js:7352:14
alasql.dexec@https://server/vendor/alasql/dist/alasql.js:4240:27
alasql.exec@https://server/vendor/alasql/dist/alasql.js:4190:10
alasql@https://server/vendor/alasql/dist/alasql.js:121:11
Index@https://server/app/states/index/index.controller.js:20:23

And those errors keep going as is the custom of Angular.

Looking for a solution I found https://github.com/SheetJS/js-xlsx/issues/184 but that didn't seem to help me out at all.

So I'm wondering if other people have encountered this and what their solution to the problem was as I'd really like to use this library but can't even get their example code to work.

EDIT:

So for those who might be coming up with the same problem...the solution I found was to add the JSZip library to my application (even though it looks like it was included with the SheetJs library) and made sure it was loaded before the Alasql piece. That seems to have done the trick...

Community
  • 1
  • 1
jb-aamc
  • 1
  • 1
  • 5
  • Please try with the latest version of alasql - it shuld work now: https://cdn.jsdelivr.net/alasql/0.2/alasql-worker.min.js – mathiasrw May 03 '16 at 11:12

1 Answers1

0

It seems you are using it with requirejs or some dependency library

You will either need to include all .js files with the distribution or add them as a dependency in shim

Raskolnikov
  • 121
  • 2
  • 7