PptxGenJS icon indicating copy to clipboard operation
PptxGenJS copied to clipboard

Using SheetJS with PptxGenJS gives "Uncaught TypeError: zip.generateAsync is not a function"

Open jenkinsns opened this issue 9 years ago • 7 comments

Hi Brent,

First Thank you for this PptxGebJS Library, really very helpfull

Yesterday I have added in the same page to download excel also, for that I have included (xlsx.core.min.js and xls.core.min.js) library files. https://github.com/SheetJS/js-xlsx

After that pptx download trowing zip.generateAsync is not a function error. Could you please guide to fix this issue.

maybe silly question,

regards Jenkins NS

error

jenkinsns avatar Nov 16 '17 12:11 jenkinsns

Hi @jenkinsns,

It sounds like SheetJS may have clobbered JSZip.

What's the version?

screen shot 2017-11-16 at 12 34 54

gitbrent avatar Nov 16 '17 18:11 gitbrent

Yes I am using 3.1.1 JSZip version

jenkinsns avatar Nov 17 '17 10:11 jenkinsns

I have changed to 3.1.5 JSZip version, still the same error. SheetJS is working by PptxGenJS gives "Uncaught TypeError: zip.generateAsync is not a function"

jenkinsns avatar Nov 20 '17 11:11 jenkinsns

I can't really help with something like your setup here... The zip method is being clobbered or lost somewhere along the line, so you may have to add some debugging/console output to watch the process and see where it falls apart.

gitbrent avatar Nov 20 '17 15:11 gitbrent

Sure, Thank you

jenkinsns avatar Nov 21 '17 17:11 jenkinsns

@jenkinsns did you find any solution??

I'm having the same issue.

filiponegrao avatar Dec 13 '17 18:12 filiponegrao

As a similar JSZip Issue says, the PptxGenJS library is being clobbered by another library (or isn't included in your scripts).

  • Make sure you load pptxgenjs.js last in your <script> block.
  • Make sure you are either using the pptxgenjs.bundle.js file or that you've included jszip.js

screen shot 2017-12-13 at 20 36 41

Check JSZip Open the console after the page is fully loaded and ensure that JSZip 3.0 is loaded. Version 3.0 added the generateAsync() method.

screen shot 2017-11-16 at 12 34 54

Lastly, try using the demo: examples/pptxgenjs-demo.html

gitbrent avatar Dec 14 '17 02:12 gitbrent