gildas-lormeau / zip.js

JavaScript library to zip and unzip files supporting multi-core compression, compression streams, zip64, split files and encryption.
https://gildas-lormeau.github.io/zip.js
BSD 3-Clause "New" or "Revised" License
3.4k stars 510 forks source link

The sendErrorMessage function is called with undefined. #439

Closed negezor closed 1 year ago

negezor commented 1 year ago

Hi, I've discovered an intermittent bug that is only fixed by reloading the browser.

Uncaught (in promise) TypeError: Cannot destructure property 'message' of 'e' as it is undefined.
    at Pe (49d3298e-9912-4393-a26f-6a7894623a15:1:13914)
    at De (49d3298e-9912-4393-a26f-6a7894623a15:1:13750)
Pe @ 49d3298e-9912-4393-a26f-6a7894623a15:1
De @ 49d3298e-9912-4393-a26f-6a7894623a15:1
await in De (async)
(anonymous) @ 49d3298e-9912-4393-a26f-6a7894623a15:1

image_2023-08-07_19-58-01 The only place I found in the code that refers to this error is here

https://github.com/gildas-lormeau/zip.js/blob/4ab1265c570f9508d35a72b36dc56810e54ef58c/lib/core/z-worker-core.js#L127-L129

Versions @zip.js/zip.js: 2.7.20 Chrome: 115.0.5790.171

gildas-lormeau commented 1 year ago

Thank you for the report. I added a default value for the parameter passed to sendErrorMessage() in the version 2.7.21.

https://github.com/gildas-lormeau/zip.js/blob/1b72460aead492c0ac3bdcc566307a15edea7752/lib/core/z-worker-core.js#L151