cthackers / adm-zip

A Javascript implementation of zip for nodejs. Allows user to create or extract zip files both in memory or to/from disk
MIT License
2.02k stars 374 forks source link

ReferenceError: totalEntries is not defined #526

Open agustaf9 opened 1 month ago

agustaf9 commented 1 month ago
Error occurred in handler for 'writePacketFile': ReferenceError: totalEntries is not defined
    at Object.compressToBuffer (c:\Users\agustaf9\Downloads\test-app\node_modules\adm-zip\zipFile.js:297:13)
    at Object.writeZip (c:\Users\agustaf9\Downloads\test-app\node_modules\adm-zip\adm-zip.js:892:32)
    at Hu (c:\Users\agustaf9\Downloads\test-app\src\main\main.ts:115:7)
    at async WebContents.<anonymous> (node:electron/js2c/browser_init:2:83537) {stack: 'ReferenceError: totalEntries is not defined
 …us> (node:electron/js2c/browser_init:2:83537)', message: 'totalEntries is not defined'}

Looking at https://github.com/cthackers/adm-zip/blob/b148463f5f9f67427df6dd19798cdce20bde3d74/zipFile.js#L297 the variable is never initialized

agustaf9 commented 1 month ago

This fixes my issue, not sure if something else was overlooked when the change was initially made though: https://github.com/cthackers/adm-zip/pull/527

ob1 commented 1 month ago

+1 Experiencing this too