Skip to content

[BUG] downloadZip is not a function when running the build script #47

@wlinna

Description

@wlinna

Describe the bug
The unmodified worker demo doesn't start the download, it only shows downloadZip is not a function error when trying to download.

The issue is that the worker.js produced by the build script is an ES-module, and needs hand-editing to turn it into an IIFE.

To Reproduce
Steps to reproduce the behavior:

  1. Clone the repo (I'm on commit c740db5)
  2. Run npm run start
  3. Start a web-server at the root dir of the repo (in my case python3 -m http.server 8000)
  4. Open http://localhost:8000/demo/worker.html in your browser
  5. Add https://raw.githubusercontent.com/Touffy/client-zip/master/CHANGES.md to the list of URLs
  6. Click Download all that in one ZIP
  7. Observe the downloadZip is not a function

Expected behavior
Start the download (I haven't actually seen how the demo should work)

Workaround
Instead of compiling the scripts yourself, use a prebuilt worker.js from npm, GitHub Releases or remove module wrapper manually.

Desktop (please complete the following information):

  • OS: Pop!_OS 22.04 LTS
  • Browser: Chromium 105 with and without incognito mode. No extensions installed
  • Browser: Firefox 104

Additional context
npm --version 8.15
node --version v16.17.0
python3 --version 3.10.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions