node-pptx icon indicating copy to clipboard operation
node-pptx copied to clipboard

TypeError: zip.files.hasOwnProperty is not a function

Open lengerrong opened this issue 4 years ago • 4 comments

TypeError: zip.files.hasOwnProperty is not a function at PowerPointFactory.loadFromRawFileData (node_modules/nodejs-pptx/lib/factories/index.js:42:27) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:95:5) at async Presentation.loadExistingPPTX (node_modules/nodejs-pptx/lib/presentation.js:99:13) at async Composer.load (node_modules/nodejs-pptx/lib/composer.js:15:9)

lengerrong avatar Aug 05 '21 06:08 lengerrong

I ran into this same error when using this library in an AWS lambda function with a NodeJS environment.

woemler avatar Sep 22 '21 14:09 woemler

Same error in pure project with node-pptx only. On Windows 10.

xuxicheta avatar Jan 25 '22 14:01 xuxicheta

Hi guys. Same error too and I resolved.

/node_modules/nodejs-pptx/lib/factories/index.js:42

- if (zip.files.hasOwnProperty(key)) {
+ if (Object.prototype.hasOwnProperty.call(zip.files, key)) {

like https://github.com/heavysixer/node-pptx/pull/84/commits/efe21998639f2b5295f4350e860cfe0a2238a2d7

have a good day. :)

kobusan avatar Apr 09 '22 15:04 kobusan

This solves the issue - can you please create a tag or new version I cannot you this package

adi-mb avatar Aug 20 '22 17:08 adi-mb