0

On Friday January 3rd, 2019, pptxgenjs library has been upgraded from version 2.6.0 to 3.0.0. This being said when I upgraded the package and attempted to start my server it gave me the following error

ReferenceError: JSZip is not defined
    at Object.<anonymous> (/Users/a.farghaly/Desktop/up-api/node_modules/pptxgenjs/dist/pptxgen.min.js:2:190018)
    at Module._compile (internal/modules/cjs/loader.js:936:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
    at Module.load (internal/modules/cjs/loader.js:790:32)
    at Function.Module._load (internal/modules/cjs/loader.js:703:12)
    at Module.require (internal/modules/cjs/loader.js:830:19)
    at require (internal/modules/cjs/helpers.js:68:18)
    at Object.<anonymous> (/Users/a.farghaly/Desktop/upsiide-api/utility/powerpoint/ppt.js:1:19)
    at Module._compile (internal/modules/cjs/loader.js:936:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
[nodemon] app crashed - waiting for file changes before starting...

This being said JSZip works fine with the previouse version (2.6.0)

I would be thankful if anyone can help me with this issue

A screenshot from npmjs.com main page trying pptxgenjs v3.0.0 enter image description here

2 Answers2

1

It's a bug: https://github.com/gitbrent/PptxGenJS/issues/638

Using https://github.com/gitbrent/PptxGenJS.git#2cee3f0c412106aefb1f87fc16bfef78ae5521a7 and it works with NodeJS.

jmto
  • 291
  • 3
  • 7
0

It’s a bug where Node was referencing dist/pptxgenjs.min.js intead of dist/pptxgenjs.min.js. In pptxgenjs.min.js jszip library is not defined