Skip to content

wxt zip including .git/ folder in sources zip #738

Closed

Description

@uncenter

Describe the bug

Turns out aklinker1/publish-browser-extension#21 is actually due to the sources zip being 30x larger (6mb to 190mb) after upgrading from 0.17.3 to 0.18.x, and Mozilla refusing to accept such a wildly large file. I believe this is due to #674 somehow leading to my .git/ folder being included in the sources zip, confirmed after downloading it from the release assets of my project and listing the contents of it:

CleanShot 2024-06-16 at 14 54 43@2x

Also either that, zipping so many .git/ files, or #501, is causing FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory when I try to run wxt zip on 0.18.x.

Reproduction

Not minimal unfortunately but easily demonstrates the issue by changing the version of wxt installed: https://github.com/catppuccin/github-file-explorer-icons.

Steps to reproduce

  1. git clone --recurse-submodules https://github.com/catppuccin/github-file-explorer-icons.git
  2. pnpm install in the project directory.
  3. pnpm zip:firefox, note that WXT will list the size of the sources zip in the terms of 100s of MB.
  4. pnpm add -D [email protected]
  5. Delete the dist/ directory for good measure (I think this bug was even including its own output zips in later zips?).
  6. pnpm zip:firefox, note that WXT will list the size of the sources zip as 5-6 MB.

System Info

System:
    OS: macOS 15.0
    CPU: (8) arm64 Apple M1
    Memory: 85.48 MB / 8.00 GB
    Shell: 3.7.1 - /run/current-system/sw/bin/fish
  Binaries:
    Node: 20.14.0 - ~/.local/state/fnm_multishells/10829_1718488770533/bin/node
    npm: 10.7.0 - ~/.local/state/fnm_multishells/10829_1718488770533/bin/npm
    pnpm: 9.3.0 - ~/.local/state/fnm_multishells/5285_1718466025130/bin/pnpm
    bun: 1.1.10 - /run/current-system/sw/bin/bun
  Browsers:
    Chrome: 126.0.6478.61
    Safari: 18.0
  npmPackages:
    wxt: 0.18.6 => 0.18.6

Used Package Manager

pnpm

Validations

Activity

  1. added
    pending-triage
    on Jun 16, 2024
  2. aklinker1 commented on Jun 17, 2024

    @aklinker1
    Member

    Ok, this is bad. If dot files are being included in ZIPs by default, I need to address that ASAP.

    For now, I'll revert #674 and release an update. Not at home right now, so give me a few hours.

  3. aklinker1 commented on Jun 17, 2024

    @aklinker1
    Member

    Reverted in #742. Prepping release now.

  4. aklinker1 commented on Jun 17, 2024

    @aklinker1
    Member

    For future reference, when I get around to fixing this, this didn't cause dotfiles in the root directory to be included, it included non-dotfiles inside dotfile directories, like .git. Need to add a test to catch this, re-enable the two tests skipped in #742, and fix both issues.

  5. added and removed
    pending-triage
    on Jun 17, 2024
  6. aklinker1 commented on Jun 17, 2024

    @aklinker1
    Member

    Revert released in v0.18.7

  7. uncenter commented on Jun 17, 2024

    @uncenter
    ContributorAuthor

    Amazing thank you! Glad you could figure out the issue - I was scratching my head for a good bit why that test wasn't catching this 😅

  8. aklinker1 commented on Jun 26, 2024

    @aklinker1
    Member

    Looks like this line might be the problem?

    Noticed this when reviewing someone else's PR, but looks like this is only excluding hidden files, not hidden directories.

  9. uncenter commented on Jun 26, 2024

    @uncenter
    ContributorAuthor

    Maybe! Probably best to implement the fixed tests you mentioned earlier and then see if changing that glob does the trick?

  10. aklinker1 commented on Jun 26, 2024

    @aklinker1
    Member

    Yup, just wanted to write that down so I don't forget about it when I get around to this

  11. added a commit that references this issue on Aug 4, 2024
    22f3d7b
  12. aklinker1 commented on Aug 8, 2024

    @aklinker1
    Member

    Closed by #902

  13. aklinker1 commented on Aug 12, 2024

    @aklinker1
    Member

    Released in v0.19.5

  14. added theissue type on Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions