gildas-lormeau/zip.js

Safari 14.1.2 error -> ReferenceError: Can't find variable: zip

NickKilo opened this issue · 5 comments

Hi there,
I've written a code to download a file, which works perfectly in Chrome but in Safari on MacOS (Safari Version 14.1.2 (16611.3.10.1.6)) it returns the message: " ReferenceError: Can't find variable: zip".
This refers to a part of my code in which I create a new zip writer, like:
const zipWriter = new zip.ZipWriter(new zip.BlobWriter("application/zip"));

Is it because this Safari version does not support FileReader/Filewriter?

Thank you in advance for your help.

PS:

  1. I'm using latest release of zip.js (v 2.7.35)
  2. before trying to download, at launch I receive as well this error referring to zip-full.min.js: ' SyntaxError: Unexpected private name #g. Cannot parse class method with private name. '

The error Unexpected private name #g cannot be thrown on packages published on NPM or Deno. I guess you used the built files from GitHub or a mirror. Anyway, I reverted the changes related to this error on GitHub. Could you try to update zip.js and run again your code?

Hi, thanks for your prompt reply.
I confirm you I'm using the built files from GitHub, downloaded and added to the main app directory.

After updating zip.js with version 2.7.36, I now receive this error in Safari :
Unhandled Promise Rejection: TypeError: options.signal must be AbortSignal
It actually is the same error I was receiving with versions 2.7.34.

Hoping to find a fix to this, thank your for your time.

I don't don't know what you are doing. Please provide some code and the full stack-trace at least.

I'm converting the issue to a question because using AbortController is not mandatory. Feel free to provide some code if you need some help.